[cfe-dev] How to compile using Clang?

Csaba Raduly rcsaba at gmail.com
Wed May 9 00:52:02 PDT 2012


Hi Michaelm

On Wed, May 9, 2012 at 2:41 AM, Michal Stefanow <mstefanow at gmail.com> wrote:
> On 4 May 2012 08:19, Csaba Raduly <rcsaba at gmail.com> wrote:
>>
>> make CXXFLAGS=-v
>>
>> This will pass the -v flag to clang, causing it to print the
>> directories where headers are searched, among other things. Perhaps
>> this will help understand why the compiler doesn't find sys/types.h (I
>> suspect this option:  -isysroot /Developer/SDKs/MacOSX10.6.sdk).
>
>
> That is actually very good hint :)
>
> Here is full output: http://pastebin.com/HhVEVLTG
>
> Most important parts:

Actually, you omitted some important parts :)

ignoring nonexistent directory
"/Developer/SDKs/MacOSX10.6.sdk/usr/local/include"
ignoring nonexistent directory "/Developer/SDKs/MacOSX10.6.sdk/usr/include"
ignoring nonexistent directory
"/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks"
ignoring nonexistent directory
"/Developer/SDKs/MacOSX10.6.sdk/Library/Frameworks"

> #include "..." search starts here:
> #include <...> search starts here:
>  .
>  deps/
>  deps/http-parser
>  deps/json_spirit
>  /usr/bin/../lib/clang/3.1/include
> End of search list.
> In file included from deps/http-parser/http_parser.c:21:
> deps/http-parser/http_parser.h:28:10: fatal error: 'sys/types.h' file not
> found
> #include <sys/types.h>
>

>
> I haven't used makefiles for a while - can you help me solving this
> "puzzle"? :)

Change the makefile to not pass the      -isysroot
/Developer/SDKs/MacOSX10.6.sdk         option to clang.
It's the CFLAGS line.

Alternatively, install the Mac OSX 10.6 SDK into /Developer/SDKs

-- 
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
The Tao of math: The numbers you can count are not the real numbers.
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds




More information about the cfe-dev mailing list