简体   繁体   English

未解析的外部符号“ std :: basic_string”

[英]unresolved external symbol “std::basic_string”

I am trying to compile a project with Maven via the Visual C++ compiler and I keep getting linkage errors in regards to the std::basic_string class. 我正在尝试通过Visual C ++编译器使用Maven编译项目,而关于std :: basic_string类,我一直收到链接错误。 I ensured that I include the < string > header file into the corresponding c++ file. 我确保将<string>头文件包含在相应的c ++文件中。

Did I miss something or did I make a silly mistake??? 我错过了什么还是我犯了一个愚蠢的错误??? Please let me know where I went wrong. 请让我知道我哪里出错了。

[ERROR] Parsor.obj : error LNK2001: unresolved external symbol

"__declspec(dllimport) public:
    int __thiscall std::basic_string<
        char,
        struct std::char_traits<char>,
        class std::allocator<char> >::compare(
            class std::basic_string<
                char,
                struct std::char_traits<char>,
                class std::allocator<char> > const &) const"

(__imp_?compare@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEHABV12@@Z)

It seems that the linker settings might be incorrect in your VC++. 看来在VC ++中,链接器设置可能不正确。 Try a simple program to test std::strig functionality 尝试一个简单的程序来测试std :: strig功能

Possible duplicate to: 可能重复到:

unresolved external symbol..no idea 无法解析的外部符号..不知道

Solving “locally defined symbol” and “unresolved external symbol” that originates from the .lib files 解决源自.lib文件的“本地定义的符号”和“未解析的外部符号”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM