链接器工具错误 LNK1313

检测到 ijw/native 模块;不能与纯模块链接

备注

Visual C++ 的当前版本不支持将本机或混合托管/本机 .obj 文件与用 .obj 编译的 /clr:pure 文件进行链接。

/clr:pure 编译器选项在 Visual Studio 2015 中已弃用,并且在 Visual Studio 2017 及更高版本中不受支持。

Example

源文件 LNK1313.cpp

// LNK1313.cpp
// compile with: /c /clr:pure
// a pure module
int main() {}

源文件 LNK1313_b.cpp

// LNK1313_b.cpp
// compile with: /c /clr
// an IJW module
void test(){}

以下示例将生成LNK1313。

// LNK1313_c.cpp
// compile with: /link LNK1313.obj LNK1313_b.obj
// LNK1313 warning expected