[cfe-dev] compiling C++ with clang++
Roman Divacky
rdivacky at freebsd.org
Tue Mar 2 04:31:41 PST 2010
On Tue, Mar 02, 2010 at 05:58:18AM -0500, Salman Pervez wrote:
> I'm trying to compile a fairly simple C++ program with clang++. I get
> the following error message
>
> vec.cpp:1:10: fatal error: 'iostream' file not found
> #include <iostream>
> ^
> 1 diagnostic generated.
>
> After looking around a bit on the clag website I came across this
> wonderful hack
>
> - Look for the comment "FIXME: temporary hack: hard-coded paths" in
> clang/lib/Frontend/InitHeaderSearch.cpp and change the lines below to
> include that path.
>
> After adding the relevant paths I still get this linker error
>
> /tmp/cc-TKUPKY.o:
> (.gnu.linkonce.r._ZZ18__gthread_active_pvE20__gthread_active_ptr+0x0):
> undefined reference to `__gthrw_pthread_cancel(unsigned long)'
> collect2: ld returned 1 exit status
> clang: error: linker command failed with exit code 1 (use -v to see
> invocation)
>
> Has anyone come across a similar situation? thanks,
this was recently fixed... either update your clang/llvm or use clang++ -O2
More information about the cfe-dev
mailing list