filament: Arch linux clang doesn't find standard library headers

Describe the bug With standard clang version 6.0.1 and gcc version 8.2.1 (delivers std lib on arch) there is an issue of clang complaining that he does not find following headers:

  • string
  • map
  • cmath
  • functional
  • limits

When compiling self written programs these issues do not occur. I’ve tried to edit the CMakeLists.txt by adding the include_directories where these files reside. This works, but then multiple files complain about an undeclared identifier “strlen”. I suppose the issue resides in customizing parameters when executing clang.

The cmake generator line i use is provided in your build guide: CC=/usr/bin/clang CXX=/usr/bin/clang++ \ cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../debug/filament ../..

This happens on a standard clean install of arch linux with the newest version of clang and gcc.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16

Most upvoted comments

I have the same problem with Arch and the libc++ from AUR.

Building with ./build release says that ld cannot find -lc++.

But if I try ld -lc++ --verbose then ld finds libc++:

attempt to open /usr/x86_64-pc-linux-gnu/lib64/libc++.so failed
attempt to open /usr/x86_64-pc-linux-gnu/lib64/libc++.a failed
attempt to open /usr/lib/libc++.so succeeded
...

Maybe It’s something to do with how ninja finds the libraries, I don’t really know how ninja works. I think I’ll try to build using a Docker image when I have the time.