Unresolved externals in C++ when using vectors and find

前端 未结 4 1532
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 12:33

I have tried this code in a totally separate project, and it works fine (the only difference being that the project that is not working is being exported as a DLL). Here is

相关标签:
4条回答
  • 2020-11-30 12:47

    I found another forum post, where somebody seems to have reported the same exact problem that you are having. Please check to see if you have

    _DEBUG
    

    defined either in your project settings (under C/C++ -- Preprocessor) or somewhere in your code (or include files).

    It looks as if std::vector thinks you are building a debug build, when you are in fact creating a release build.

    I hope this helps.

    0 讨论(0)
  • 2020-11-30 12:47

    Worked for me with : The problem in my case was a Debug configuration with Runtime Library set to Multi-threaded DLL. The fix was to change it to Multi-threaded Debug DLL

    0 讨论(0)
  • 2020-11-30 13:06

    The problem was I had _DEBUG defined in C/C++->Preprocessor. Changing it to NDEBUG solved the problem.

    0 讨论(0)
  • 2020-11-30 13:11

    The problem in my case was a Debug configuration with Runtime Library set to Multi-threaded DLL. The fix was to change it to Multi-threaded Debug DLL. The error is gone. Removing _DEBUG macro was also a kind of workaround, by I guess it's not a good idea because you end up with debug build linked to non-debug standard library.

    0 讨论(0)
提交回复
热议问题