C++ 使用 wofstream 时未解析的外部符号
C++ Unresolved external symbol when using wofstream
我正在从批处理文件编译和链接此源代码,我现在正在导入的库MSVCRT.LIB Kernel32.lib User32.lib
代码一直有效,直到我包含string
iostream
和fstream
并创建一些wofstream
对象。这时链接器向我展示了一大堆未解析的符号,其中包括:
std::_BADOFF
static class std::locale::id std::codecvt
std::_Xout_of_range
std::_Fiopen
std::basic_streambuf
std::char_traits
std::basic_ios
std::locale::id::operator unsigned _int64
所以我想知道我可能错过了哪些图书馆。在链接器中,我指定了/nodefaultlib
选项,以便我可以决定使用哪些库,但现在我遇到了这个问题,找不到这些标准函数的库。
简短:MSVCPRT.LIB
这些符号在运行时库中定义C++。虽然你确实与MSVCRT.lib
链接(注意没有字母P),但这只是C,而不是C++运行时。
这是MSDN页面,您可能会找到有用的 http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
相关文章:
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- 未解析的外部符号_MsiLocateComponentW@12.
- 在C++中使用 gRPC 时未解析的外部符号
- LibPrivoxy: 未解析的外部符号 __declspec(dllimport) int __stdcall Sta
- 尝试从 XamlApplication 编译 C++/WinRT 空白应用程序时,我收到未解析的外部符号 winrt_make_*
- 我收到错误LNK2001:未解析的外部符号(C++代码)
- 可视抽象类 c++(错误 LNK 2001:未解析的外部符号)
- 如何摆脱C++中未解析的外部符号"private: static char"错误?
- 当 lib 已添加到其他依赖项时,如何在 VS 中调试未解析的外部符号错误
- 仅在少数方法(静态或共享库)中解析的外部符号
- 未解析的外部符号"__declspec(dllimport)与 Spdlog c++ 库
- 函数 _main (OPENGL C++) 中引用的未解析的外部符号 ________
- 错误LNK2019未解析的外部符号"public: __thiscall SLinkList<char>::SLinkList<char>(void)"
- 使用静态 constexpr 成员的未解析外部符号
- 引入参数化构造函数后显示 LNK 2019 未解析外部符号的代码错误
- Dlib LNK2001未解析的外部符号USER_ERROR__consistent_build_configurati
- 矛盾的未解决的外部符号+未使用的库与VS2017和FFMPEG 4
- 链接器错误:切换到unicode生成给出:未解析的外部符号WinMain
- 类模板上一个特定函数的未解析外部符号
- LNK2001:未解析的外部符号public:static类std::vector