[LLVMdev] include's are not being located

Jonathan Roelofs jonathan at codesourcery.com
Mon Jun 16 12:35:21 PDT 2014



On 6/16/14, 1:14 PM, Dan Liew wrote:
> Hi Joseph,
>
>> In other words what does " put '--std=c++11' in the CXXFLAGS” mean? Do you
>> have an example of what it would look like? or what should I read in order
>> to learn this? I’m happy to read up but I don’t know where to start reading
>> (besides the getting started page on llvm)   :)
>
> You're still trying to build the tutorial right? I assume you
> successfully built LLVM already. So if you're building the tutorial
> you probably just need this.
>
> clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --libs core` -o toy
>
> I see your `llvm-config --cxxflags`` output already has --std=c++11
> already in it (your --cppflags does not. I'm not sure why).
Dan, the preprocessor shouldn't need to know about '--std=c++11' right?

Maybe the confusion here is over which one of '--cppflags' vs '--cxxflags' to 
use where (the former is for the preprocessor, the latter is for the c++ compiler).


Also, looking at an example from earlier in the thread:

```
clang++ -g -O3 toy.cpp
`/Users/josephmorgan/build/Release+Assert/bin/llvm-config --cppflags
--ldflags --libs core` -o toy
```

This suspiciously looks like you're using the just-built llvm-config to give 
parameters to the system installed clang++. IOW, this could lead you into 
trouble if `which clang++` doesn't point you to the one in 
/Users/josephmorgan/build/Release+Assert/bin/ (this really depends on what's on 
your PATH).

>
> I think Jonanthan may have confused you because his suggestion of
>
> ../llvm/configure CXX=`which clang++` CXXFLAGS="--std=c++11"
>
> is for configuring and building LLVM/Clang which you've already done.
Yes, this suggestion is for configuring/building clang... sorry if that added to 
the confusion.
> So you shouldn't need to do that again.
>
> Thanks,
>

Cheers,
Jon

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the llvm-dev mailing list