0

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.

ali
  • 10,927
  • 20
  • 89
  • 138
  • Not an answer (hence a comment): Why are you afraid of linking the standard libraries? – Sebastian Mach Oct 29 '13 at 09:11
  • Well, I just wanted to know what specific libraries I have to link for string, iostream and fstream, but I can link all the standard libraries. At least, can I know what libraries are included in the standard? – ali Oct 29 '13 at 09:13
  • The standard does not define any compiler framework. E.g., a compiler would be allowed to carry all definitions in itself and then hard wire them in your program. Or it is allowed to divide into any number of libraries; e.g. in the GNU framework, the math library would be a separate one. – Sebastian Mach Oct 29 '13 at 09:54

1 Answers1

1

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

Anton
  • 978
  • 5
  • 11