[cfe-users] libcxx.llvm.org linux build instructions unclear

Larry Evans cppljevans at suddenlink.net
Thu Jul 10 13:46:42 PDT 2014


On 07/10/2014 03:23 PM, Jeffrey Walton wrote:
>> Unfortunately, when using libcxx with a hello_world.cpp, get missing files:
>>
>> make
>> ls -ld /usr/local/lib/libc++*
>> lrwxrwxrwx 1 root root      11 Jul 10 12:45 /usr/local/lib/libc++.so ->
>> libc++.so.1
>> lrwxrwxrwx 1 root root      13 Jul 10 12:45 /usr/local/lib/libc++.so.1 ->
>> libc++.so.1.0
>> -rw-r--r-- 1 root root 1054759 Jul 10 11:53 /usr/local/lib/libc++.so.1.0
>> ls -ld /usr/local/include/c++/v1/../*
>> drwxr-xr-x 19 root root 4096 Jul  7 12:11 /usr/local/include/c++/v1/../4.9.0
>> drwxr-xr-x  5 root root 4096 Jul 10 12:45 /usr/local/include/c++/v1/../v1
>> /usr/local/bin/clang++ -std=c++11 -stdlib=libc++ -nostdinc
>> -I/usr/local/include/c++/v1 -I/usr/local/include/c++/v1/../4.9.0
>> -L/usr/local/lib hello_world.cpp -o hello_world.exe
>> In file included from hello_world.cpp:1:
>> /usr/local/include/c++/v1/../4.9.0/iostream:38:10: fatal error:
>> 'bits/c++config.h' file not found
>> #include <bits/c++config.h>
>>           ^
>> 1 error generated.
>> make: *** [run] Error 1
>>
>> Anyone have any ideas how to get libcxx to work on ubuntu?
>>
> Its a distant memory, but....
>
> I seem to recall I had to use -I to include the path to the correct
> headers like <bits/c++config.h>. This was on Debian with an updated
> Clang (I built and used 3.3 in /usr/local/bin, while Debian provided
> 3.1, IIRC).
>
> Jeff
>
Thanks Jeff.  That got me a little farther, but now missing other
files.  First had to add another -I for features.h, but now I'm
getting compile error as well as another missing file:

make
ls -ld /usr/local/lib/libc++*
lrwxrwxrwx 1 root root      11 Jul 10 12:45 /usr/local/lib/libc++.so -> 
libc++.so.1
lrwxrwxrwx 1 root root      13 Jul 10 12:45 /usr/local/lib/libc++.so.1 
-> libc++.so.1.0
-rw-r--r-- 1 root root 1054759 Jul 10 11:53 /usr/local/lib/libc++.so.1.0
ls -ld /usr/local/include/c++/v1/../*
drwxr-xr-x 19 root root 4096 Jul  7 12:11 /usr/local/include/c++/v1/../4.9.0
drwxr-xr-x  5 root root 4096 Jul 10 12:45 /usr/local/include/c++/v1/../v1
/usr/local/bin/clang++ -std=c++11 -stdlib=libc++ -nostdinc 
-I/usr/local/include/c++/v1 
-I/usr/local/include/c++/4.9.0/x86_64-unknown-linux-gnu 
-I/usr/local/include/c++/4.9.0 -I/usr/local/include/c++/4.9.0/parallel 
-L/usr/local/lib hello_world.cpp -o hello_world.exe
In file included from hello_world.cpp:1:
In file included from /usr/local/include/c++/4.9.0/iostream:38:
In file included from 
/usr/local/include/c++/4.9.0/x86_64-unknown-linux-gnu/bits/c++config.h:430:
/usr/local/include/c++/4.9.0/x86_64-unknown-linux-gnu/bits/os_defines.h:44:19: 
error: token is not a valid binary operator in a
       preprocessor subexpression
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
     ~~~~~~~~~~~~~~^
In file included from hello_world.cpp:1:
In file included from /usr/local/include/c++/4.9.0/iostream:39:
In file included from /usr/local/include/c++/4.9.0/ostream:38:
In file included from /usr/local/include/c++/4.9.0/ios:38:
In file included from /usr/local/include/c++/4.9.0/iosfwd:40:
In file included from /usr/local/include/c++/4.9.0/bits/postypes.h:40:
/usr/local/include/c++/4.9.0/cwchar:44:10: fatal error: 'wchar.h' file 
not found
#include <wchar.h>
          ^
2 errors generated.
make: *** [run] Error 1

Compilation exited abnormally with code 2 at Thu Jul 10 15:42:43

-regards,
Larry




More information about the cfe-users mailing list