LNK2005 (already defined)

后端 未结 1 1965
暖寄归人
暖寄归人 2021-01-02 01:23

I know you\'ve seen 21728517 people asking for help with this one but after searching and reading about this I really can\'t figure this one out. I know this error, I\'ve se

相关标签:
1条回答
  • 2021-01-02 01:56

    Define the functions in misc.cpp, rather than in misc.h.

    The problem is probably due to #includeing misc.h in multiple CPP files. the header guards prevent a header from being included multiple times in the same translation unit, but each CPP file is (typically) a separate translation unit. So those functions end up getting defined twice -- once in each translation unit.

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