本人用 ubuntu16.04和win10下都不能编译成功。 1.win10下用msys2根据` git clone https://git.llvm.org/git/llvm.git git clone https://git.llvm.org/git/clang.git llvm/tools/clang
cd llvm
cmake -H. -BRelease -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DLLVM_TARGETS_TO_BUILD=X86 ninja -C Release clangFormat clangFrontendTool clangIndex clangTooling clang`
编译好 clang+llvm后编译ccls报错 $ cmake -H. -BRelease -G Ninja -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
– The CXX compiler identification is Clang 9.0.0 – Check for working CXX compiler: F:/llvm/Release/bin/clang-cl.exe – Check for working CXX compiler: F:/llvm/Release/bin/clang-cl.exe – broken CMake Error at D:/msys64/mingw64/share/cmake-3.11/Modules/CMakeTestCXXCompiler.cmake:45 (message): The C++ compiler
"F:/llvm/Release/bin/clang-cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: F:/ccls/Release/CMakeFiles/CMakeTmp
Run Build Command:"D:/msys64/mingw64/bin/ninja.exe" "cmTC_beac8"
[1/2] Building CXX object CMakeFiles\cmTC_beac8.dir\testCXXCompiler.cxx.obj
[2/2] Linking CXX executable cmTC_beac8.exe
FAILED: cmTC_beac8.exe
cmd.exe /C "cd . && D:\msys64\mingw64\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_beac8.dir --manifests -- D:\msys64\usr\bin\link.exe /nologo CMakeFiles\cmTC_beac8.dir\testCXXCompiler.cxx.obj /out:cmTC_beac8.exe /implib:cmTC_beac8.lib /pdb:cmTC_beac8.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /foCMakeFiles\cmTC_beac8.dir/manifest.res CMakeFiles\cmTC_beac8.dir/manifest.rc" failed (exit code 0) with the following output:
绯荤粺鎵句笉鍒版寚瀹氱殑鏂囦欢銆?
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project)
– Configuring incomplete, errors occurred! See also “F:/ccls/Release/CMakeFiles/CMakeOutput.log”. See also “F:/ccls/Release/CMakeFiles/CMakeError.log”.
2.在ubuntu下直接 wget -c http://releases.llvm.org/7.0.1/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz tar xf clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04
报错: cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$PWD/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04 CMake Error at CMakeLists.txt:137 (message): Error retrieving Clang resource directory with Clang executable. Output:
/home/sniper/ccls/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04/bin/clang: 5: /home/sniper/ccls/clang+llvm-7.0.1-x86_64-linux-gnu-ubuntu-16.04/bin/clang: Syntax error: “(” unexpected
– Configuring incomplete, errors occurred! See also “/home/sniper/ccls/Release/CMakeFiles/CMakeOutput.log”. See also “/home/sniper/ccls/Release/CMakeFiles/CMakeError.log”.
有人可以指导一下吗? 有傻瓜式的指令操作吗?