2

EDIT: I've fixed the problem by setting my Runtime Library to inherit from project default. I was using Multi-treaded DLL(/MT) because a SDL-2 tutorial I used did that.

Can someone explain why this broke the string's of c++?


Whenever I try to use a string my compiler gives me the following errors:

LNK2019 unresolved external symbol __imp___invalid_parameter referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)"

LNK2019 unresolved external symbol __imp___CrtDbgReportW referenced in function "void * __cdecl std::_Allocate(unsigned int,unsigned int,bool)"

I've stripped all my code to the bare minimum and it is as followed:

#include <string>

int main(int argc, char *argv[]) {
    std::string resPath;
    return 0;
}

I have no idea where to look. Does anyone have an idea?

I'm using MSVS Community 2015.

Community
  • 1
  • 1
Zarathes
  • 126
  • 6

1 Answers1

2

I just had the same problem with VS2017. It turned out that I had my runtime library settings wrong. I had accidently set it to Multi-threaded DLL (/MD) for the debug configuration. It should have been Multi-threaded Debug DLL (/MDd) or Multi-threaded Debug (/MTd).