[cfe-dev] Toolset for clang in Windows under Boost

Edward Diener eldlistmailingz at tropicsoft.com
Wed Sep 22 18:45:46 PDT 2010


On 9/22/2010 7:46 PM, Francois Pichet wrote:
>>> clang can compile boost.  On windows, it should theoretically work but
>>> you may need to tweak the compiler command line options to make it
>>> work. For example, if you compile clang with VS, clang will search the
>>> msvc include directories to find #include path.
>>
>> I do not understand this. I am not talking about building clang, but
>> using clang to compile Boost. What does VS have to do with that ?
>
> Because you asked about building clang using Visual Studio in your
> first question.

I have already successfully built clang using VS 2008 and VC9.

> So I thought you wanted to build clang using visual
> studio and then using the resulting clang to build boost. It is not
> going to work because when you build clang using visual studio the
> default configuration is to search in the msvc include directories for
> standard headers. clang cannot parse these headers.
>
>>
>>> But clang cannot
>>> currently parse the msvc header files.
>>
>> Are you saying that clang needs the msvc header files under Windows ?
>
> Not, if you build using MinGW.
> If you build with MSVC clang will try to include from msvc by default.
> To get around that use option  -nostdinc++ and -nostdinc.
>
>
>> It sounds like you are saying that when clang is built with VS it
>> automatically uses the msvc header files awhen it is used to compile
>> source files but if it is built with MingW it automatically uses the
>> MingW header files when it is used to compile source files. Can that
>> really be so ? I would have assumed that however it is built it would
>> use its own header files and standard library.
>
> That's the way clang works as I understand.

That does not make sense to me. However clang is built should be 
irrelevant when one uses it. If clang really operates the way you 
describe in Windows I would consider that a major flaw of the 
implementation.

> clang doesn't currently
> ship with its own complete standard library. One is currently in
> development ( libc++) but doesn't work on windows.

OK, that I can believe.

>
>> As far as the Windows SDK header files I would guess that some Boost
>> libraries do use them, but I do not know why they would not be able to
>> be used by clang.
>
> clang cannot currently compile the Windows SDK as provided by Microsoft.
> clang can compile the Windows headers shipped with MinGW.

Then I will use the MingW headers when compiling clang. But I can not 
believe that I would have had to build clang with MingW to do that.




More information about the cfe-dev mailing list