1
我在Visual Studio 2008中编写了一个C++应用程序。我已经将Windows窗体添加到我的项目中,启用了CLR支持并添加了一行来实例化窗体。重建C++时的链接器错误 - CLI项目std :: basic_string
因为这样做,我得到的链接错误的负载如下:
错误LNK2001:无法解析的外部符号“市民:虚拟类的std :: basic_string的<焦炭,结构的std :: char_traits <字符> ,类std :: allocator < char>> __thiscall ...“(...)
任何想法我做错了什么?
完整的错误(匿名):
1>Linking...
1> Creating library C:\***.lib and object C:\***.exp
1>getProducts.obj : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>getProducts.obj : error LNK2001: unresolved external symbol "protected: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall ***::GetClassName(void)const " ([email protected]***@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@XZ)
1>MSVCRT.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>C:\***.exe : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://c:\***\BuildLog.htm"
1>getProducts - 10 error(s), 12 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========
您链接了您的库吗? – Geoffroy 2011-06-11 15:46:51
链接库目录设置为“是”。有什么特定的图书馆我需要链接? – 2011-06-11 15:58:03
不知道我从来没有在视觉工作室工作过。你能把完整的错误? – Geoffroy 2011-06-11 15:59:25