How can I configure LLVM Clang 6.0 with CLION 2018.1

已回答

Hi,
Please help me on this matter,I tried some attempts and failed,I am newby to CMAKE kind of stuff, need your assistance regarding this issue.
I downloaded clang  form here
Currently, CLion 2018.1 support this VisualStudio,MinGW,Cygwin and WSL (configurations)platforms only,
Where I was stuck, when it is required  to given makefile absolute paths,
Here a snapshot of that,

Please help me on this matter! If you can support me by step by step instruction it would be a great help. I really love CLion IDE.


Please, Jetbrains CLion team can you give us user-friendly support for clang compiler with next release onwards?

0

Hello!

As you correctly mentioned, to work with CLion on Windows you need to have Cygwin, or MinGW, or Windows Subsystem for Linux (WSL), or Visual Studio. If you want to use Clang, you need to install Cygwin or MinGW and to install Clang as a MinGW/Cygwin package. For example, in this comment you can find a detailed instruction for MinGW.

0
Avatar
Permanently deleted user

Thank you Anna for the reply, So don't we have an option to configure official clang x64 release for windows with CLion?

0

You can't use clang in CLion on Windows without having MinGW or Cygwin installed. You can try the following:

1) Install MinGW or Cygwin and specify it in the "Environment" field in File | Settings | Build, Execution, Deployment | Toolchains.

2) Specify installed clang.exe and clang++.exe in the "C Compiler" and "C++ Compiler" fields (like you do it now) if it's crucial for you to use this particular distribution.

0
Avatar
Permanently deleted user

@Anna Can we use LLDB with CLION 2018 ? or Only GDB supported on Windows Environment? and another thing is since Valgrind has no Windows build, how to run memcheck and profiling?

Please look at the image below 

Error saying "Error running "Build All": Valgrind executable is not found". Please need your help on this.

 

0

>Can we use LLDB with CLION 2018 ?

LLDB is bundled only for macOS and Linux. Since the LLDB on Windows is still under development, we don't test nor explicitly support this configuration. If you manage to set it up for your case, chances are CLion will also be able to use it.

>Valgrind has no Windows build

Valgrind Memcheck in CLion works on Windows only via WSL. Please see the related blog post for more details.

1
Avatar
Permanently deleted user

@Anna thank you very much for the support.

0
Avatar
Permanently deleted user

In fact the latest version of Clions 2018.2 running on windows 10 environment work with LLVM clang version 6/6.0.1 or even 7.0 couple with   GCC mingw x64 win32 specific  variant.

 

Please select the right toolchain in your project setting as either

x64 or 32 specific version which have  tested to work on Clions/windows environment

C:\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0 or C:\mingw-w64\i686-8.1.0-win32-dwarf-rt_v6-rev0

and also setting the right target for LLVM clang  with  gcc default linker not visual studio

CMake build setup as below

cmake_minimum_required(VERSION 3.10)
project(project_name )

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_C_COMPILER "c:/llvm/bin/clang.exe")
set(CMAKE_CXX_COMPILER "c:/llvm/bin/clang++.exe")
// target i686-pc-windows-gnu for 32bit
set(CLANG_COVERAGE_COMPILE_FLAGS "-v -target x86_64-pc-windows-gnu -Wall -Wextra -std=gnu++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_COVERAGE_COMPILE_FLAGS}" )
add_executable(project_name yourcpp.cpp)


0

Also we have a feature request about supporting Clang in CLion on Windows (without MinGW or Cygwin): https://youtrack.jetbrains.com/issue/CPP-10711. Feel free to comment or upvote it in order to get updates.

0
Avatar
Permanently deleted user

Installed clang and lldb in msys2-mingw distribution, when select lldb as debugger and try to debug I get:

C:\msys64\mingw64\bin\lldb.exe: unknown option -- interpreter=mi2
error: unknown or ambiguous option

Process finished with exit code 0
0

@Msink, LLDB on Windows is still not supported in CLion. Please follow updates in our blog to be aware of changes on this subject.

0

请先登录再写评论。