本文介绍了将VS2008 MFC项目迁移到具有链接器错误的64位系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MFC项目,它使用VS2008在32位系统中构建和运行良好。但是,由于PC兼容问题,我们已将此项目迁移/移植到64位系统。


该项目由几个Dll和一个调用这些Dll的主项目组成。所有项目都已设置为x64环境。在构建DLL项目时我没有遇到任何问题,但是,在构建主项目时我遇到了很多这些链接器错误。


我曾尝试修改主项目中的stdafx.h文件但仍然是一样的。


任何可以帮助我吗?提前谢谢。





1> Am.obj:错误LNK2001:未解析的外部符号" __ declspec(dllimport) public:class ATL :: CStringT< char,class StrTraitMFC_DLL< char,class ATL :: ChTraitsCRT< char> > > const& __cdecl SpApiDb :: GetModel(long)const" (__imp_?GetModel @ SpApiDb @@ QEBAAEBV?$ CStringT @ DV?$ StrTraitMFC_DLL @ DV?$ ChTraitsCRT @ D @ ATL @@@@@ ATL @@ J @ Z)

1> AuDlg。 obj:错误LNK2001:未解析的外部符号" __ declspec(dllimport)public:class ATL :: CStringT< char,class StrTraitMFC_DLL< char,class ATL :: ChTraitsCRT< char> > > const& __cdecl SpApiDb :: GetModel(long)const" (__imp_?GetModel @ SpApiDb @@ QEBAAEBV?$ CStringT @ DV?$ StrTraitMFC_DLL @ DV?$ ChTraitsCRT @ D @ ATL @@@@@ ATL @@ J @ Z)

1>条形码。 obj:错误LNK2001:未解析的外部符号" __ declspec(dllimport)public:class ATL :: CStringT< char,class StrTraitMFC_DLL< char,class ATL :: ChTraitsCRT< char> > > const& __cdecl SpApiDb :: GetModel(long)const" (__imp_?GetModel @ SpApiDb @@ QEBAAEBV?$ CStringT @ DV?$ StrTraitMFC_DLL @ DV?$ ChTraitsCRT @ D @ ATL @@@@@ ATL @@ J @ Z)

1> BlkEdit。 obj:错误LNK2001:未解析的外部符号" __ declspec(dllimport)public:class ATL :: CStringT< char,class StrTraitMFC_DLL< char,class ATL :: ChTraitsCRT< char> > > const& __cdecl SpApiDb :: GetModel(long)const" (__imp_?GetModel @ SpApiDb @@ QEBAAEBV?$ CStringT @ DV?$ StrTraitMFC_DLL @ DV?$ ChTraitsCRT @ D @ ATL @@@@@ ATL @@ J @ Z)

1> Am。 obj:错误LNK2019:函数"int __cdecl XccdSet(void)"中引用的未解析的外部符号__imp_Xccd_GetStatus (?XccdSet @@ YAHXZ)
$
1> Am.obj:错误LNK2019:未解析的外部符号__imp_Xccd_Init在函数"int __cdecl XccdSet(void)"中引用(?XccdSet @@ YAHXZ)
$
1> Am.obj:错误LNK2019:函数中引用的未解析的外部符号__imp_Xccd_ReadCCDdataMem" void __cdecl grab_imageX(类Halcon :: Hobject *,int)" (?grab_imageX @@ YAXPEAVHobject @ Halcon @@ H @ Z)
$
1> Am.obj:错误LNK2019:未解析的外部符号__imp_Xccd_TriggerShutter在函数中引用"void __cdecl grab_imageX(类Halcon :: Hobject * ,INT)" (?grab_imageX @@ YAXPEAVHobject @ Halcon @@ H @ Z)

1> Am.obj:错误LNK2019:函数中引用的未解析的外部符号__imp_Fx2_CloseDev" void __cdecl ImageClose(void)" (?ImageClose @@ YAXXZ)
解决方案

I have a MFC project which is building and running fine in 32 bits system with VS2008. However, we have migrate/port this project to 64 bit system due to PC compatible issue.

The project consists of a few Dlls and a main project that calls those Dlls. All of projects had been set to x64 environment. I face no issues when building the DLL projects, however, I got lots of these linker errors when building the main project.

I had tried to modify the stdafx.h file in the main project but still the same.

Any can help me on this? Thank you in advance.


1>Am.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const & __cdecl SpApiDb::GetModel(long)const " (__imp_?GetModel@SpApiDb@@QEBAAEBV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z)
1>AuDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const & __cdecl SpApiDb::GetModel(long)const " (__imp_?GetModel@SpApiDb@@QEBAAEBV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z)
1>Barcode.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const & __cdecl SpApiDb::GetModel(long)const " (__imp_?GetModel@SpApiDb@@QEBAAEBV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z)
1>BlkEdit.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > const & __cdecl SpApiDb::GetModel(long)const " (__imp_?GetModel@SpApiDb@@QEBAAEBV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@J@Z)
1>Am.obj : error LNK2019: unresolved external symbol __imp_Xccd_GetStatus referenced in function "int __cdecl XccdSet(void)" (?XccdSet@@YAHXZ)
1>Am.obj : error LNK2019: unresolved external symbol __imp_Xccd_Init referenced in function "int __cdecl XccdSet(void)" (?XccdSet@@YAHXZ)
1>Am.obj : error LNK2019: unresolved external symbol __imp_Xccd_ReadCCDdataMem referenced in function "void __cdecl grab_imageX(class Halcon::Hobject *,int)" (?grab_imageX@@YAXPEAVHobject@Halcon@@H@Z)
1>Am.obj : error LNK2019: unresolved external symbol __imp_Xccd_TriggerShutter referenced in function "void __cdecl grab_imageX(class Halcon::Hobject *,int)" (?grab_imageX@@YAXPEAVHobject@Halcon@@H@Z)
1>Am.obj : error LNK2019: unresolved external symbol __imp_Fx2_CloseDev referenced in function "void __cdecl ImageClose(void)" (?ImageClose@@YAXXZ)
解决方案


这篇关于将VS2008 MFC项目迁移到具有链接器错误的64位系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 17:26