将32位代码编译为64位

时间:2013-03-08 13:01:06

标签: c++ visual-studio-2010

我获得了编译64位3d Max插件的作业。

项目在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__ *)" (__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)

我做错了什么?

1 个答案:

答案 0 :(得分:2)

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