Problem building clang on Windows 7

CodeLite installation/troubleshooting forum
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problem building clang on Windows 7

Post by eranif »

You need to add the include paths for clang ( the gcc default ones )

For example, for me, I had to add the following line into:

Settings -> Build Settings -> Compilers -> clang++ -> Advanced -> Include Paths

Code: Select all

c:\mingw-4.7.1\lib\gcc\mingw32\4.7.1\include\c++;c:\mingw-4.7.1\lib\gcc\mingw32\4.7.1\include\c++\mingw32;c:\mingw-4.7.1\lib\gcc\mingw32\4.7.1\include\c++\backward;c:\mingw-4.7.1\lib\gcc\mingw32\4.7.1\include;c:\mingw-4.7.1\include;c:\mingw-4.7.1\lib\gcc\mingw32\4.7.1\include-fixed
and it worked. Remember that you also need to disable EH (Exception Handling) using -fno-exceptions flag

Eran
Make sure you have read the HOW TO POST thread
tikkun
CodeLite Curious
Posts: 8
Joined: Wed Dec 11, 2013 2:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problem building clang on Windows 7

Post by tikkun »

Damn, this is like having your teeth pulled by Hannibal Lecter...
well did a little research and found this which led me here for a canonical source, at the bottom of the page, wow. And so:

  • Code: Select all

    C:\>clang -v -o test.exe test.c
    clang version 3.5 (197095)
    Target: i686-pc-mingw32
    Thread model: posix
    Selected GCC installation:
     "C:\clang-src\build\bin\clang.exe" -cc1 -triple i686-pc-mingw32 -emit-obj -mrelax-all -disable-free -disable-llvm-verif
    ier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
    -target-cpu pentium4 -v -resource-dir "C:\\clang-src\\build\\bin\\..\\lib\\clang\\3.5" -fdebug-compilation-dir "C:\\" -f
    error-limit 19 -fmessage-length 120 -mstackrealign -fno-use-cxa-atexit -fobjc-runtime=gcc -fdiagnostics-show-option -fco
    lor-diagnostics -vectorize-slp -o "C:\\Users\\nikita\\AppData\\Local\\Temp\\test-aaabfa.o" -x c test.c
    clang -cc1 version 3.5 based upon LLVM 3.5svn default target i686-pc-mingw32
    ignoring nonexistent directory "/usr/local/include"
    ignoring nonexistent directory "C:\clang-src\build\bin\..\lib\clang\3.5\../../../i686-w64-mingw32/include"
    ignoring nonexistent directory "C:\clang-src\build\bin\..\lib\clang\3.5\../../../x86_64-w64-mingw32/include"
    ignoring nonexistent directory "/mingw/include"
    ignoring nonexistent directory "c:/mingw/include"
    ignoring nonexistent directory "/usr/include"
    #include "..." search starts here:
    #include <...> search starts here:
     C:\clang-src\build\bin\..\lib\clang\3.5\include
     C:\clang-src\build\bin\..\lib\clang\3.5\../../../include
    End of search list.
    test.c:1:10: fatal error: 'stdio.h' file not found
    #include <stdio.h>
             ^
    1 error generated.
    
The -v switch is terribly verbose and gives the search path(s) of which I have none. I think I can handle this...
tikkun
CodeLite Curious
Posts: 8
Joined: Wed Dec 11, 2013 2:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Problem building clang on Windows 7

Post by tikkun »

eranif wrote:You need to add the include paths for clang ( the gcc default ones )

For example, for me, I had to add the following line into:

Settings -> Build Settings -> Compilers -> clang++ -> Advanced -> Include Paths

Eran
That's where the @#% it was?!!! I thought I would lose it when I couldn't find where you'd update the include path. Danke sehr, Eran!
Post Reply