“LNK2022: metadata operation failed” driving me insane

后端 未结 3 650
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-05 17:35

I have a big solution with lots of projects, using VS2008 SP1, and at least once a day I encounter the LNK2022 error. If I do a full rebuild of the solution it builds fine,

3条回答
  •  天涯浪人
    2020-12-05 18:27

    Try this in xxx.cpp and xxx2.cpp:

    #ifndef _PROTECT_MY_HEADER
    #define _PROTECT_MY_HEADER
    #include  "inc.h"
    #endif
    

    #pragma once isn't enough to protect the header in this case.

提交回复
热议问题