Recent Changes - Search:

Home Page


Main

Downloads
Windows
macOS
Linux (via apt / rpm )
Linux wxWidgets
Release Notes

Wiki
Documentation
FAQ

Build CodeLite
Linux
Windows
macOS

Devs
Debug CodeLite Linux
Building Clang
Build wxWidgets (MSW)
Coding Guidelines
Create a Plugin

ClangCompiler


Setting up clang in codelite


This document describes how to define clang as a compiler in codelite

Windows

Linux

Defining new compiler in codelite

Since codelite 5.2, clang compiler is defined out-of-the-box in codelite so you only need to add the include paths

Next, we want to define clang as a compiler in codelite.

  • From the main menu: Settings -> Build Settings -> Compilers -> New... in the dialog the pops, type the name clang and click OK
  • In the Tools page of the newly created clang compiler, replace all g++ instances with clang++ and all gcc with clang
  • Windows only Select the Advanced page of the clang compiler and under the Include Paths add all gcc include paths as a semi-colon separated list

you can copy the include paths from Settings -> Tags Settings -> clang

For example, under my windows machine my clang include paths under Settings -> Tags Settings -> clang contains this:

c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include\c++
c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include\c++\mingw32
c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include\c++\backward
c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include
c:\mingw-4.7.1\include
c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include-fixed

Copy the content, paste it into an empty document and convert it to a single semi-colon string

c:\mingw-4.6.1\lib\gcc\mingw32\4.6.1\include\c++;c:\mingw-4.7.1\lib\gcc\mingw32\4.6.1\include\c++\mingw32 ...

Next, paste it under the Settings -> Build Settings -> Compiler -> clang -> Advanced -> Include Paths

Define new project template for clang

Since codelite 5.2 this step is no longer needed

  • Create a new project of type 'console g++' ( Workspace -> New Project )
  • Right click on the project and select Settings -> General
  • Change the compiler type from gnu g++ to clang and click OK
  • Right click on the project and select Save as template and give it a name and description
  • From now on, you can use this template to create new clang console projects
Edit - History - Print - Recent Changes - Search
Page last modified on July 30, 2013, at 08:10 AM