我正在 Code::Blocks 中使用 MinGW-W64 7.1.0 (seh, posix) 制作一个简单的内核模式驱动程序。我正在使用“include/ddk”中的内置 DDK 头文件进行编译。但是构建失败并出现该错误:
||=== Build: Release in test_driver (compiler: GNU GCC Compiler) ===|
C:\mingw64\x86_64-w64-mingw32\include\ddk\wdm.h|361|error: redefinition of '_InterlockedAdd64'|
C:\mingw64\x86_64-w64-mingw32\include\ddk\wdm.h|376|note: in expansion of macro 'InterlockedAdd64'|
C:\mingw64\x86_64-w64-mingw32\include\psdk_inc\intrin-impl.h|1035|note: previous definition of '_InterlockedAdd64' was here|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
相同的代码在 TDM-GCC 64 位上编译得很好,但它使用的是一个非常旧的 GCC 版本,5.1.0。
我尝试了具有不同线程模型和异常的旧版本的 MinGW-W64,但没有成功。
可能我错过了一些东西。
提前致谢。