How to set up correctly clang on VSC. Windows

Viewed 31

Well, as u maybe know the C++ extension (C++ Intellisense is deprecated) i wanted to move on clang. i installed it and then i set up correctly environment variables. Properly installed clang Next step was generate compile_commands.json file by cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. . Unlucky it doesn't work. cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 .. so i add to CMakeLists.txt these 3 lines of code.

    set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE BOOL "Enable/Disable output of compile commands during generation.")
    set(CMAKE_C_COMPILER   "/Program Files/LLVM/bin/clang.exe" CACHE STRING "C compiler" FORCE)
    set(CMAKE_CXX_COMPILER "/Program Files/LLVM/bin/clang++.exe" CACHE STRING "C++ compiler" FORCE)

and tried to build it with cmake -G"Unix Makefiles" .. . Still got some fails. Console after cmake How can i use it properly to not get that type of errors ? Windows,VSC, C++. Errors in code

0 Answers
Related