debug : LNK2019
发布日期:2021-06-30 22:15:08
浏览次数:2
分类:技术文章
本文共 1438 字,大约阅读时间需要 4 分钟。
使用vs2005 + STLport-5.2.1, 编译时出现LNK2019错.
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall stlp_std::basic_string,class stlp_std::allocator >::~basic_string ,class stlp_std::allocator >(void)" (__imp_??1?$basic_string@GV?$char_traits@G@stlp_std@@V?$allocator@G@2@@stlp_std@@QAE@XZ) referenced in function _wmain srcVoteState.obj
用屏蔽法定位到
std::wstring strRc;
想起在编译选项时,改过选项 wchar_t build in, 使wchar不为内建类型(/Zc:wchar_t-).
回想StlPort编译过程, 当时选择的是默认选项编译, 没有选择 /G7 选项. 将vs2005工程的wchar_t build in 改回yes编译通过.
stlPort 编译时使用 wchar_t build in 选项如下:
echo.echo "--extra-cxxflag"echo Use this option to add any compilation flag to the build system. For instanceecho it can be used to activate a specific processor optimization depending on yourecho processor. For Visual C++ .Net 2003, to activate pentium 3 optim you will use:echo --extra-cxxflag /G7echo If you have several options use several --extra-cxxflag options. For instanceecho to also force use of wchar_t as an intrinsic type:echo --extra-cxxflag /G7 --extra-cxxflag /Zc:wchar_t
如果加载的第三方库多了, 出现LNK2019, 就需要将所有Lib的wchar_t build in 选项统一. 比如codeproject上的一些demo, 如果不选(/Zc:wchar_t-), 就编译不过.
<2011_1026>
今天,同事遇到vs2003ide中贴入vs2005工程中拷贝进来的代码, 编译不过提示是 "不可是别的0xA6", 用另存编码的方法没解决问题。后来他查到是贴进来的代码中用到的宏编码不正确,但是这个宏在另外一个文件中粘贴进来的. 后来他手工键入了那个宏,搞定. 看来修改要一小步一小步的来, 要不这种奇怪得问题,不好排查。
转载地址:https://lostspeed.blog.csdn.net/article/details/6897938 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月24日 03时09分06秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
ACM路上的一大失误
2019-04-30
HDOJ2049 不容易系列之(4)——考新郎
2019-04-30
CodeForces 248B - Chilly Willy - 找规律
2019-04-30
POJ-2418 Hardwood Species(Trie树)(map)
2019-04-30
HDU 1592 Half of and a Half(高精度)
2019-04-30
UVA-11538 Chess Queen(数学)
2019-04-30
UVA-11401 Triangle Counting(数学优化)
2019-04-30
Codeforces Round #369 (Div. 2)
2019-04-30
UVA 11426 GCD - Extreme (II)(欧拉函数)
2019-04-30
HDU-2838 Cow Sorting(树状数组)
2019-04-30
POJ-2299 Ultra-QuickSort(树状数组)(离散化)
2019-04-30
基于SSM的兼职论坛系统的设计与实现
2019-04-30
基于java的ssm框架就业信息管理系统的设计
2019-04-30
基于java的SSM框架的教务关系系统的设计与实现
2019-04-30
如何用同期群分析模型提升留存?(Tableau实战)
2019-04-30
爱了,吹爆这个高颜值的流程图工具!
2019-04-30
基于JAVA_JSP电子书下载系统
2019-04-30
2021最新 上海互联网公司排名
2019-04-30
字节vs快手!取消大小周之战
2019-04-30