4542|8

62

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

链接错误 VS2005,但没问题在EVC4 [复制链接]

大家好,
最近我转换了一个项目从EVC4到VS2005,在EVC中编译也链接都没问题,但在VS2005,却出现了下面的link error:
研究了很长时间,都没有解决,希望大家能给点帮助。
tils.obj : warning LNK4049: locally defined symbol ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ@4DB (char const `private: static char const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C) imported
mfcs80ud.lib(stdafx.obj) : error LNK2001: unresolved external symbol __imp__CrtDbgReportW
FavoriteManager.obj : error LNK2019: unresolved external symbol __imp__CrtDbgReportW referenced in function "public: char * __cdecl ATL::CTempBuffer::AllocateBytes(unsigned int)" (?AllocateBytes@?$CTempBuffer@D$0IA@VCCRTAllocator@ATL@@@ATL@@QAAPADI@Z)
PersistencyInterface.obj : error LNK2001: unresolved external symbol __imp__CrtDbgReportW
ResString.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@XZ)
RouteInfo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
POICategoriesList.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::_Lockit::~_Lockit(void)" (__imp_??1_Lockit@std@@QAA@XZ)
NavConfirmInfoDlg.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::_Lockit::~_Lockit(void)" (__imp_??1_Lockit@std@@QAA@XZ) referenced in function __unwind$109524
NavMapGuidanceDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::_Lockit::~_Lockit(void)" (__imp_??1_Lockit@std@@QAA@XZ)
POIElementFilter.obj : error LNK2019: unresolved external symbol "public: struct MULTIFIRSTLETTER __cdecl CHanziToPinyin::GetFirstLetter(wchar_t)" (?GetFirstLetter@CHanziToPinyin@@QAA?AUMULTIFIRSTLETTER@@_W@Z) referenced in function "protected: virtual bool __cdecl CPOIElementFilter::filter(class NSVD::CPoiData const &)" (?filter@CPOIElementFilter@@MAA_NABVCPoiData@NSVD@@@Z)
atlsd.lib(atltypes.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(atlbase.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(AtlTraceModuleManager.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(Allocate.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(AtlDebugAPI.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function AtlTraceRegister
atlsd.lib(Externs.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(atltrace.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
atlsd.lib(atltime.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW

最新回复

不是,我是想把单字节转换有宽字节, 其实我认为是std::wstring的错,因为 如果我声明一个warning C4231: nonstandard extension used : 'extern' before template explicit instantiation temp这样的变量,它也会出现同样的link error.  详情 回复 发表于 2007-12-28 17:28
点赞 关注

回复
举报

71

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
应该是你没有使用正确的SDK
 
 

回复

59

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
this kind error, just need change the C/C++->code generation-> runtime library "Multi-threaded Debug (/MTd)" ->Multi-threaded Debug DLL (/MDd)
 
 
 

回复

61

帖子

0

TA的资源

一粒金砂(初级)

4
 
不行,还是有错
Utils.obj : warning LNK4049: locally defined symbol ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ@4DB (char const `private: static char const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C) imported
Utils.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@XZ)
RouteListDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::~basic_string,class std::allocator >(void)" (__imp_??1?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@XZ)
NavConfirmInfoDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl
Formatter.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl Utils.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@PB_WABV?$allocator@_W@1@@Z) referenced in function __unwind$93035
NavConfirmInfoDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@PB_WABV?$allocator@_W@1@@Z)
RouteListDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_string,class std::allocator >::basic_string,class std::allocator >(wchar_t const *,class std::allocator const &)" (__imp_??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAA@PB_WABV?$allocator@_W@1@@Z)
Formatter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t * __cdecl std::basic_string,class std::allocator >::begin(void)" (__imp_?begin@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAAPA_WXZ) referenced in function __unwind$104235
Formatter.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t * __cdecl std::basic_string,class std::allocator >::end(void)" (__imp_?end@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QAAPA_WXZ) referenced in function __unwind$104235
RouteListDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
POIElementFilter.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
Formatter.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
POIDetailsDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
POIListDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
RouteInfo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) wchar_t const `private: static wchar_t const * __cdecl std::basic_string,class std::allocator >::_Nullstr(void)'::`2'::_C" (__imp_?_C@?1??_Nullstr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@CAPB_WXZ@4_WB)
POIElementFilter.obj : error LNK2019: unresolved external symbol "public: struct MULTIFIRSTLETTER __cdecl CHanziToPinyin::GetFirstLetter(wchar_t)" (?GetFirstLetter@CHanziToPinyin@@QAA?AUMULTIFIRSTLETTER@@_W@Z) referenced in function "protected: virtual bool __cdecl CPOIElementFilter::filter(class NSVD::CPoiData const &)" (?filter@CPOIElementFilter@@MAA_NABVCPoiData@NSVD@@@Z)
 
 
 

回复

70

帖子

0

TA的资源

一粒金砂(初级)

5
 
应该还是在设置上有问题。

我以前遇到这种情况就改
C/C++-> code   generation->   runtime   library   "Multi-threaded   Debug   (/MTd)"   -> Multi-threaded   Debug   DLL   (/MDd)
再不行就新建一个vs2005的工程,然后把文件从原来的工程复制过来,实现升级的。

 
 
 

回复

83

帖子

0

TA的资源

一粒金砂(初级)

6
 
在我的项目中,有这样一个Util.cpp文件,其中有下面一个方法,
std::wstring CUtils::ToWString(const std::string& s)
{
        std::wstring res;
        Utf8ToWide(s, res);
        return res;
}

我发现,如果我调用这个方法,它就会出现上面的链接错误,否则就不会出现。
我也不知道为什么?
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

7
 
你把Utf8ToWide这个函数改写了吧,
函数意思就是把std::string 转成std::wstring吧
 
 
 

回复

67

帖子

0

TA的资源

一粒金砂(初级)

8
 
stl可以用的。
 
 
 

回复

78

帖子

0

TA的资源

一粒金砂(初级)

9
 
不是,我是想把单字节转换有宽字节,
其实我认为是std::wstring的错,因为
如果我声明一个warning C4231: nonstandard extension used : 'extern' before template explicit instantiation temp这样的变量,它也会出现同样的link error.
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/10 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表