CLR/CLI linker fails with error LNK2022 - Custom attributes are not consistent

后端 未结 3 1100
自闭症患者
自闭症患者 2020-12-15 22:38

Environment: Visual Studio 10, CLR/CLI Class Library project, built with Platform Toolset v100, targeting framework version

3条回答
  •  既然无缘
    2020-12-15 23:07

    Remove the _WIN32_WINNT=0x0500 definition from the C/C++ Preprocessor

    Apparently for some reason the above preprocessor definition did not agree with the linker, causing the linker errors. I assume this is some internal Microsoft bug (?), but not sure. Anyway, after removing this preprocessor definition all built and linked correctly.

    Hope this information is useful.

提交回复
热议问题