Clang在Windows中编译兼容Linux API的代码 发表于 2025-03-13 更新于 2025-03-27 分类于 编程 , C , C++ , Clang 本文字数: 66 阅读时长 ≈ 1 分钟 首先要有MinGW兼容的编译器,在编译选项中增加-target x86_64-pc-windows-gnu即可。 选择x86_64-pc-windows-gnu目标而非Windows平台上Clang默认的x86_64-pc-windows-msvc目标。 参考 How to use clang with mingw-w64 headers on windows - Stack Overflow;