What do you need to install to use Clang on windows to build c++14 for 64 bit?

后端 未结 3 1331
轮回少年
轮回少年 2021-01-30 10:21

UPDATE:

I\'ve written a detailed tutorial that incorporates the top two answers on this question: http://blog.johannesmp.com/2015/09/01/installing-clang-on-windows-pt1/

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 10:52

    You can install llvm pre-release binary for Windows here. MinGW-w64 can be downloaded here. Of course, you should make sure the paths are properly set up.

    For the latest version of clang, e.g., clang 6.0.0. The above solution by @user5271266 will not be enough. Now the default target for clang Windows is x86_64-pc-windows-msvc (Assume that you are using 64 bit Windows).

    In order to compile C++ source files, according to here, we should change the target:

    clang++ -target x86_64-pc-windows-gnu -std=c++14 test.cc -o test.exe
    

提交回复
热议问题