小编ibl*_*lis的帖子

Windows 10上的CMake + MinGW + Clang

我想使用Clang 4.0,CMake 3.8.1,MinGW x86_64 6.3.0编译应用程序。我试过了:

cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++ ..\code
Run Code Online (Sandbox Code Playgroud)

但是由于传递Visual Studio的编译器参数,导致测试程序的编译失败。我根本不想使用Visual Studio。输出:

-- The C compiler identification is Clang 4.0.0
-- The CXX compiler identification is Clang 4.0.0
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.8/Modules/CMakeTestCCompiler.cmake:51 (message):
The C compiler "C:/Program Files/LLVM/bin/clang.exe" is not able to compile a simple test program.
clang.exe: error: no such file or directory: '/nologo'
clang.exe: error: no …
Run Code Online (Sandbox Code Playgroud)

c++ windows mingw cmake clang

5
推荐指数
1
解决办法
1359
查看次数

标签 统计

c++ ×1

clang ×1

cmake ×1

mingw ×1

windows ×1