[cfe-dev] What configure options should I use to build clang with clang?

crazygamealexs at hotmail.com crazygamealexs at hotmail.com
Tue Sep 7 18:03:20 PDT 2010



--------------------------------------------------
From: "Eric Christopher" <echristo at apple.com>
Sent: Tuesday, September 07, 2010 6:04 PM
To: <crazygamealexs at hotmail.com>
Subject: Re: [cfe-dev] What configure options should I use to build clangwithclang?

>>>
>> Can't.... here is the source
>> #include <iostream>
>> using namespace std;
>>
>> int main ()
>> {
>> cout << "Hello World!";
>> return 0;
>> }
>> and here is the error message
>> $ clang++ -I /usr/lib/gcc/i686-pc-cygwin/4.3.4/include/c++ -I 
>> /usr/lib/gcc/i686
>> -pc-cygwin/4.3.4/include/c++/i686-pc-cygwin -I 
>> /usr/lib/gcc/i686-pc-cygwin/4.3.
>> 4/include/c++/backward -I /usr/lib/gcc/i686-pc-cygwin/4.3.4/include -I 
>> /usr/lib
>> /gcc/i686-pc-cygwin/4.3.4/include-fixed -I 
>> /usr/lib/gcc/i686-pc-cygwin/4.3.4/..
>> /../../../include/w32api new.cpp
>> /usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../../i686-pc-cygwin/bin/ld: 
>> Warning: ty
>> pe of symbol `_main' changed from 32 to 512 in /tmp/cc-U9uwEP.o
>> /tmp/cc-U9uwEP.o:fake:(.text+0x14): undefined reference to 
>> `___dso_handle'
>> /tmp/cc-U9uwEP.o:fake:(.text+0x3e): undefined reference to 
>> `___cxa_atexit'
>> collect2: ld returned 1 exit status
>> clang: error: linker (via gcc) command failed with exit code 1 (use -v to 
>> see in
>> vocation)
>
> Your obvious need for all of those -I command line options means that 
> there is something incorrect in the search paths to find the header files 
> on your host.
>
> You need a compiler that will just work like:
>
> clang++ hello.cc -o hello
>
> and have that just work.
>
> Until then it doesn't matter what you pass to configure - you won't be 
> able to compile clang with clang.
>
> -eric
Your not helping at all. Your just restating the problem that I'm having. 
Yes clang doesn't include the headers by default, but what I can do about 
it?  I just recently try rebuilding it with --with-cxx-include-root 
configure on and it still doesn't search for the header files by default. On 
the"getting started" one of the solutions is so vague when it says "changes 
the lines below to include that path". What changes exactly? Any examples? 




More information about the cfe-dev mailing list