您的位置:首页 > 其它

静态库LINK2005问题

2009-10-29 16:17 183 查看
今天写了一个console主程序,一个静态库,链接时报LNK2005 错误:

error LNK2005: "public: static unsigned int __cdecl std::char_traits<char>::length(char const *)" .......

解决方法:

因为是静态库,所以要将静态库工程的runtime设定为Multi-threaded Debug (/MTd);console主程序要设定为同样的runtime。

当然,release版的就使用Multi-threaded (/MT)。

PS: 具体位置在工程属性的C/C++ ->Code Generation->Runtime Library 。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: