2013-03-08 237 views
0

我被赋予编译64位3D Max插件的任务。将32位代码编译为64位

项目编译正确下32位,但是当我跟着从这里的说明:

How to compile a 64-bit application using Visual C++ 2010 Express?

设置编译平台到x64。该项目编译,但当生成代码我得到链接器错误:

1>DllEntry.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl InitCustomControls(struct HINSTANCE__ *)" ([email protected]@[email protected]@@Z) referenced in function DllMain 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::IdentityMatrix(void)" ([email protected]@@QEAAXXZ) referenced in function "public: __cdecl Matrix3::Matrix3(int)" ([email protected]@[email protected]@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl MaxHeapOperators::operator delete(void *)" ([email protected]@[email protected]) referenced in function "public: virtual void * __cdecl SceneExport::`scalar deleting destructor'(unsigned int)" ([email protected]@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl ClassDesc2::ClassDesc2(void)" ([email protected]@[email protected]) referenced in function "public: __cdecl CMaxExporterClassDesc::CMaxExporterClassDesc(void)" ([email protected]@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::ResetClassParams(int)" ([email protected]@@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl ClassDesc2::NumParamBlockDescs(void)" ([email protected]@@UEAAHXZ) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class ParamBlockDesc2 * __cdecl ClassDesc2::GetParamBlockDesc(int)" ([email protected]@@[email protected]@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class ParamBlockDesc2 * __cdecl ClassDesc2::GetParamBlockDescByID(short)" ([email protected]@@[email protected]@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::AddParamBlockDesc(class ParamBlockDesc2 *)" ([email protected]@@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::BeginEditParams(class IObjParam *,class ReferenceMaker *,unsigned long,class Animatable *)" ([email protected]@@[email protected]@[email protected]@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::EndEditParams(class IObjParam *,class ReferenceMaker *,unsigned long,class Animatable *)" ([email protected]@@[email protected]@[email protected]@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::InvalidateUI(class ParamBlockDesc2 *)" ([email protected]@@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual char * __cdecl ClassDesc::GetRsrcString(__int64)" ([email protected]@@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::MakeAutoParamBlocks(class ReferenceMaker *)" ([email protected]@@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl ClassDesc2::NumParamMaps(void)" ([email protected]@@UEAAHXZ) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class IParamMap2 * __cdecl ClassDesc2::GetParamMap(int)" ([email protected]@@[email protected]@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class FPInterface * __cdecl ClassDesc::GetInterface(char *)" ([email protected]@@[email protected]@[email protected]) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class FPInterface * __cdecl ClassDesc::GetInterface(class Interface_ID)" ([email protected]@@[email protected]@[email protected]@@Z) 
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc::AddInterface(class FPInterface *)" ([email protected]@@[email protected]@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl ClassDesc2::SetUserDlgProc(class ParamBlockDesc2 *,short,class ParamMap2UserDlgProc *)" ([email protected]@@[email protected]@[email protected]@@Z) referenced in function "public: virtual void __cdecl ClassDesc2::SetUserDlgProc(class ParamBlockDesc2 *,class ParamMap2UserDlgProc *)" ([email protected]@@[email protected]@[email protected]@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl ClassDesc2::~ClassDesc2(void)" ([email protected]@[email protected]) referenced in function "public: virtual __cdecl CMaxExporterClassDesc::~CMaxExporterClassDesc(void)" ([email protected]@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl zfree(void * *)" ([email protected]@[email protected]) referenced in function "public: __cdecl Tab<class Point3>::~Tab<class Point3>(void)" ([email protected]@@@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl TBSetCount(struct TabHdr * *,int,int,int)" ([email protected]@[email protected]@[email protected]) referenced in function "public: void __cdecl Tab<class Point3>::SetCount(int,int)" ([email protected][email protected]@@@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class Point3 __cdecl Normalize(class Point3 const &)" ([email protected]@[email protected]@[email protected]@Z) referenced in function "public: void __cdecl VNormal::Normalize(void)" ([email protected]@@QEAAXXZ) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TVFace * __cdecl Mesh::mapFaces(int)const " ([email protected]@@[email protected]@[email protected]) referenced in function "protected: void __cdecl CMaxExporter::ExportColors(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Point3 * __cdecl Mesh::mapVerts(int)const " ([email protected]@@[email protected]@[email protected]) referenced in function "protected: void __cdecl CMaxExporter::ExportColors(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class Point3 __cdecl operator*(class Point3 const &,class Matrix3 const &)" ([email protected][email protected]@[email protected]@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl ApplyScaling(class Matrix3 &,class ScaleValue const &)" ([email protected]@[email protected]@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl PreRotateMatrix(class Matrix3 &,class Quat const &)" ([email protected]@[email protected]@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::PreTranslate(class Point3 const &)" ([email protected]@@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::SetRow(int,class Point3)" ([email protected]@@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportNormalsTangents(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Point3 __cdecl Point3::operator^(class Point3 const &)const " ([email protected]@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportNormalsTangents(class INode *,class Mesh &,struct pmesh::mesh_desc &)" ([email protected]@@[email protected]@[email protected]@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl CStr::operator char *(void)" ([email protected]@QEAAPEADXZ) referenced in function "protected: void __cdecl CMaxExporter::Log(char const *,struct pmesh::mesh_file &)" ([email protected]@@[email protected]@@@Z) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl MaxHeapOperators::operator new(unsigned __int64)" ([email protected]@[email protected]) referenced in function "public: virtual void * __cdecl CMaxExporterClassDesc::Create(int)" ([email protected]@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl Mesh::~Mesh(void)" ([email protected]@[email protected]) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" ([email protected]@@[email protected]@[email protected]@[email protected]@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Matrix3::Parity(void)const " ([email protected]@@QEBAHXZ) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" ([email protected]@@[email protected]@[email protected]@[email protected]@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Mesh::Mesh(class Mesh const &)" ([email protected]@[email protected]@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" ([email protected]@@[email protected]@[email protected]@[email protected]@@[email protected]) 
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl DebugPrint(char const *,...)" ([email protected]@YAXPEBDZZ) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" ([email protected]@@[email protected]@[email protected]@[email protected]@@[email protected]) 

我做错了什么?

+10

您的项目依赖于外部库,并且链接程序找不到该库的64位版本(或者因为您没有安装它们,或者因为它们位于不在库搜索路径中的路径中)。 – us2012 2013-03-08 13:03:37

+0

我完全同意@ us2012 – 2013-03-08 13:04:16

+0

Thx的回复。其他库目录指定的目录仅包含.lib文件,其中没有任何源代码。我认为这意味着我无法编译我的项目为X64? – 2013-03-08 13:07:42

回答

2

作为任何具有相同问题的人的后续工作:您需要在链接器 - >常规 - >附加库目录中选择库的x64变体。一旦你使用默认选项安装3Ds MAX SDK,你应该使它们位于:C:\ Program Files(x86)\ Autodesk \ maxsdk \ x64 \ lib;