1

我被分配编译一个 64 位的 3d Max 插件。

项目在 32 位下正确编译,但是当我按照此处的说明进行操作时:

如何使用 Visual C++ 2010 Express 编译 64 位应用程序?

将编译平台设置为 x64。该项目可以编译,但是在生成代码时出现链接器错误:

1>DllEntry.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl InitCustomControls(struct HINSTANCE__ *)" (__imp_?InitCustomControls@@YAXPEAUHINSTANCE__@@@Z) referenced in function DllMain
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::IdentityMatrix(void)" (__imp_?IdentityMatrix@Matrix3@@QEAAXXZ) referenced in function "public: __cdecl Matrix3::Matrix3(int)" (??0Matrix3@@QEAA@H@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl MaxHeapOperators::operator delete(void *)" (__imp_??3MaxHeapOperators@@SAXPEAX@Z) referenced in function "public: virtual void * __cdecl SceneExport::`scalar deleting destructor'(unsigned int)" (??_GSceneExport@@UEAAPEAXI@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl ClassDesc2::ClassDesc2(void)" (__imp_??0ClassDesc2@@QEAA@XZ) referenced in function "public: __cdecl CMaxExporterClassDesc::CMaxExporterClassDesc(void)" (??0CMaxExporterClassDesc@@QEAA@XZ)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::ResetClassParams(int)" (?ResetClassParams@ClassDesc2@@UEAAXH@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl ClassDesc2::NumParamBlockDescs(void)" (?NumParamBlockDescs@ClassDesc2@@UEAAHXZ)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class ParamBlockDesc2 * __cdecl ClassDesc2::GetParamBlockDesc(int)" (?GetParamBlockDesc@ClassDesc2@@UEAAPEAVParamBlockDesc2@@H@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class ParamBlockDesc2 * __cdecl ClassDesc2::GetParamBlockDescByID(short)" (?GetParamBlockDescByID@ClassDesc2@@UEAAPEAVParamBlockDesc2@@F@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::AddParamBlockDesc(class ParamBlockDesc2 *)" (?AddParamBlockDesc@ClassDesc2@@UEAAXPEAVParamBlockDesc2@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::BeginEditParams(class IObjParam *,class ReferenceMaker *,unsigned long,class Animatable *)" (?BeginEditParams@ClassDesc2@@UEAAXPEAVIObjParam@@PEAVReferenceMaker@@KPEAVAnimatable@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::EndEditParams(class IObjParam *,class ReferenceMaker *,unsigned long,class Animatable *)" (?EndEditParams@ClassDesc2@@UEAAXPEAVIObjParam@@PEAVReferenceMaker@@KPEAVAnimatable@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::InvalidateUI(class ParamBlockDesc2 *)" (?InvalidateUI@ClassDesc2@@UEAAXPEAVParamBlockDesc2@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual char * __cdecl ClassDesc::GetRsrcString(__int64)" (?GetRsrcString@ClassDesc@@UEAAPEAD_J@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc2::MakeAutoParamBlocks(class ReferenceMaker *)" (?MakeAutoParamBlocks@ClassDesc2@@UEAAXPEAVReferenceMaker@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl ClassDesc2::NumParamMaps(void)" (?NumParamMaps@ClassDesc2@@UEAAHXZ)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class IParamMap2 * __cdecl ClassDesc2::GetParamMap(int)" (?GetParamMap@ClassDesc2@@UEAAPEAVIParamMap2@@H@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class FPInterface * __cdecl ClassDesc::GetInterface(char *)" (?GetInterface@ClassDesc@@UEAAPEAVFPInterface@@PEAD@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual class FPInterface * __cdecl ClassDesc::GetInterface(class Interface_ID)" (?GetInterface@ClassDesc@@UEAAPEAVFPInterface@@VInterface_ID@@@Z)
1>exporter.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl ClassDesc::AddInterface(class FPInterface *)" (?AddInterface@ClassDesc@@UEAAXPEAVFPInterface@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl ClassDesc2::SetUserDlgProc(class ParamBlockDesc2 *,short,class ParamMap2UserDlgProc *)" (__imp_?SetUserDlgProc@ClassDesc2@@QEAAXPEAVParamBlockDesc2@@FPEAVParamMap2UserDlgProc@@@Z) referenced in function "public: virtual void __cdecl ClassDesc2::SetUserDlgProc(class ParamBlockDesc2 *,class ParamMap2UserDlgProc *)" (?SetUserDlgProc@ClassDesc2@@UEAAXPEAVParamBlockDesc2@@PEAVParamMap2UserDlgProc@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl ClassDesc2::~ClassDesc2(void)" (__imp_??1ClassDesc2@@UEAA@XZ) referenced in function "public: virtual __cdecl CMaxExporterClassDesc::~CMaxExporterClassDesc(void)" (??1CMaxExporterClassDesc@@UEAA@XZ)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl zfree(void * *)" (__imp_?zfree@@YAXPEAPEAX@Z) referenced in function "public: __cdecl Tab<class Point3>::~Tab<class Point3>(void)" (??1?$Tab@VPoint3@@@@QEAA@XZ)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl TBSetCount(struct TabHdr * *,int,int,int)" (__imp_?TBSetCount@@YAXPEAPEAUTabHdr@@HHH@Z) referenced in function "public: void __cdecl Tab<class Point3>::SetCount(int,int)" (?SetCount@?$Tab@VPoint3@@@@QEAAXHH@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class Point3 __cdecl Normalize(class Point3 const &)" (__imp_?Normalize@@YA?AVPoint3@@AEBV1@@Z) referenced in function "public: void __cdecl VNormal::Normalize(void)" (?Normalize@VNormal@@QEAAXXZ)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TVFace * __cdecl Mesh::mapFaces(int)const " (__imp_?mapFaces@Mesh@@QEBAPEAVTVFace@@H@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportColors(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportColors@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Point3 * __cdecl Mesh::mapVerts(int)const " (__imp_?mapVerts@Mesh@@QEBAPEAVPoint3@@H@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportColors(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportColors@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class Point3 __cdecl operator*(class Point3 const &,class Matrix3 const &)" (__imp_??D@YA?AVPoint3@@AEBV0@AEBVMatrix3@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportVertices@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl ApplyScaling(class Matrix3 &,class ScaleValue const &)" (__imp_?ApplyScaling@@YAXAEAVMatrix3@@AEBVScaleValue@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportVertices@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl PreRotateMatrix(class Matrix3 &,class Quat const &)" (__imp_?PreRotateMatrix@@YAXAEAVMatrix3@@AEBVQuat@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportVertices@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::PreTranslate(class Point3 const &)" (__imp_?PreTranslate@Matrix3@@QEAAXAEBVPoint3@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportVertices(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportVertices@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Matrix3::SetRow(int,class Point3)" (__imp_?SetRow@Matrix3@@QEAAXHVPoint3@@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportNormalsTangents(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportNormalsTangents@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Point3 __cdecl Point3::operator^(class Point3 const &)const " (__imp_??TPoint3@@QEBA?AV0@AEBV0@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportNormalsTangents(class INode *,class Mesh &,struct pmesh::mesh_desc &)" (?ExportNormalsTangents@CMaxExporter@@IEAAXPEAVINode@@AEAVMesh@@AEAUmesh_desc@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl CStr::operator char *(void)" (__imp_??BCStr@@QEAAPEADXZ) referenced in function "protected: void __cdecl CMaxExporter::Log(char const *,struct pmesh::mesh_file &)" (?Log@CMaxExporter@@IEAAXPEBDAEAUmesh_file@pmesh@@@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl MaxHeapOperators::operator new(unsigned __int64)" (__imp_??2MaxHeapOperators@@SAPEAX_K@Z) referenced in function "public: virtual void * __cdecl CMaxExporterClassDesc::Create(int)" (?Create@CMaxExporterClassDesc@@UEAAPEAXH@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl Mesh::~Mesh(void)" (__imp_??1Mesh@@UEAA@XZ) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" (?ExportMesh@CMaxExporter@@IEAAXPEAVINode@@PEAVObject@@PEAUmesh_node@pmesh@@_N@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl Matrix3::Parity(void)const " (__imp_?Parity@Matrix3@@QEBAHXZ) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" (?ExportMesh@CMaxExporter@@IEAAXPEAVINode@@PEAVObject@@PEAUmesh_node@pmesh@@_N@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Mesh::Mesh(class Mesh const &)" (__imp_??0Mesh@@QEAA@AEBV0@@Z) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" (?ExportMesh@CMaxExporter@@IEAAXPEAVINode@@PEAVObject@@PEAUmesh_node@pmesh@@_N@Z)
1>exporter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl DebugPrint(char const *,...)" (__imp_?DebugPrint@@YAXPEBDZZ) referenced in function "protected: void __cdecl CMaxExporter::ExportMesh(class INode *,class Object *,struct pmesh::mesh_node *,bool)" (?ExportMesh@CMaxExporter@@IEAAXPEAVINode@@PEAVObject@@PEAUmesh_node@pmesh@@_N@Z)

我究竟做错了什么?

4

1 回答 1

2

作为任何有相同问题的人的后续行动:您需要在 Linker->General->AdditionalLibraryDirectories 中选择库的 x64 变体。使用默认选项安装 3Ds MAX SDK 后,它们应该位于:C:\Program Files (x86)\Autodesk\maxsdk\x64\lib;

于 2013-10-29T19:36:42.467 回答