How can I resolve this link error in Visual Studio (LNK2005)?

后端 未结 4 1241
我寻月下人不归
我寻月下人不归 2021-01-05 20:50

I keep having linker errors of the following form:

libcmtd.dll msvmrtd.dll some element(ex: _mkdir ) already defined...

4条回答
  •  忘掉有多难
    2021-01-05 20:56

    Check a few things:

    1. Are your header files guarded. I.e. do they have #ifndef guards.

    2. Are you defining (non-template) functions in headers without the inline keyword. That messes lots of stuff up.

    3. Are you trying to define templates in a .cpp file. All template definitions need to be in headers.

    Post some code and exact error text please!

提交回复
热议问题