Pergunta

I am compiling and linking this source code from a batch file and the libraries that I am importing right now are MSVCRT.LIB Kernel32.lib User32.lib
The code works until I include string iostream and fstream and create some wofstream objects. That's when the linker shows me a large list of unresolved symbols, among which:

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

so I wonder what libraries might I be missing. In the linker I specified the /nodefaultlib options so I can decide what libraries to use but right now I have this problem and can't find the libraries for these standard functions.

Foi útil?

Solução

Short: MSVCPRT.LIB

These symbols are defined in C++ Runtime Library. Although you do link with MSVCRT.lib (note the absence of letter P), that's only C, not C++ runtime.

And here is MSDN page you may find useful http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top