Hi,<div><br></div><div>I'm not compiling the header directly, it is included in another header, which is included in a *.cpp file. So, the extension should be interpreted as signaling a c++ source, right? What I did was basically</div>
<div><br></div><div>export CC=cflags</div><div>export CXX=cflags++</div><div>export CPP=cflags++</div><div><br></div><div>and then running the configure phase followed by a compilation phase. It really seems the C and not C++ mode is working here but I wonder why is that. Anyway, thanks a lot for the replies</div>
<div><br></div><div>Regards,</div><div>Stefano</div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Nov 5, 2010 at 12:56 PM, Sebastian Redl <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 05.11.2010 12:27, Frits van Bommel wrote:<br>
> On Fri, Nov 5, 2010 at 12:15 PM, Sebastian Redl<br>
> <<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>>  wrote:<br>
>> Sounds like you're trying to compile C++ code as C. Just because you<br>
>> invoke Clang as clang++ doesn't mean it runs in C++ mode, it only means<br>
>> it will link against the C++ runtime libraries. To actually compile in<br>
>> C++ mode, the file must have a C++ extension (.cxx, .cpp or .cc), or you<br>
>> have to override the language detection with the -x option.<br>
> It does, actually. From clang/tools/driver/driver.cpp:<br>
><br>
>    // Check for ".*++" or ".*++-[^-]*" to determine if we are a C++<br>
>    // compiler. This matches things like "c++", "clang++", and "clang++-1.1".<br>
>    //<br>
>    // Note that we intentionally want to use argv[0] here, to support "clang++"<br>
>    // being a symlink.<br>
>    //<br>
>    // We use *argv instead of argv[0] to work around a bogus g++ warning.<br>
>    const char *progname = argv_[0];<br>
>    std::string ProgName(llvm::sys::Path(progname).getBasename());<br>
>    if (llvm::StringRef(ProgName).endswith("++") ||<br>
>        llvm::StringRef(ProgName).rsplit('-').first.endswith("++")) {<br>
>      TheDriver.CCCIsCXX = true;<br>
>    }<br>
</div>That still doesn't mean that it will automatically use C++ as the input<br>
language. It might mean that it interprets .h files differently.<br>
<font color="#888888"><br>
Sebastian<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>