Issue 1262 in include-what-you-use: stddef.h not found

32 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
May 25, 2023, 11:17:01 AM5/25/23
to include-wh...@googlegroups.com
New issue 1262 by feux-follets: stddef.h not found
https://github.com/include-what-you-use/include-what-you-use/issues/1262

System version:
Arch WSL
clang 15
gcc 13
iwyu compiled with clang 15

```c++
#include <string>
int main(){
return 0;
}
```

```
$ include-what-you-use main.cpp
In file included from main.cpp:1:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/string:42:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/bits/char_traits.h:42:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/bits/postypes.h:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/cwchar:44:
/usr/include/wchar.h:35:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
^~~~~~~~~~
```



notifi...@include-what-you-use.org

unread,
May 25, 2023, 12:40:20 PM5/25/23
to include-wh...@googlegroups.com
Comment #1 on issue 1262 by kimgr: stddef.h not found
https://github.com/include-what-you-use/include-what-you-use/issues/1262

Did you build iwyu yourself using Cmake? If so, the cmake steps should have copied the clang builtin headers into the right place in the build dir. Can you say a bit more about how you built?


notifi...@include-what-you-use.org

unread,
May 25, 2023, 1:22:41 PM5/25/23
to include-wh...@googlegroups.com
Comment #2 on issue 1262 by feux-follets: stddef.h not found
https://github.com/include-what-you-use/include-what-you-use/issues/1262

> Did you build iwyu yourself using Cmake? If so, the cmake steps should have copied the clang builtin headers into the right place in the build dir. Can you say a bit more about how you built?

Checked out clang_15 branch.

```
cmake -DCMAKE_PREFIX_PATH=/usr/lib ../include-what-you-use
```

LLVM libs are located under /usr/lib
```
-rwxr-xr-x 1 root root 102K Apr 8 13:45 LLVMgold.so*
lrwxrwxrwx 1 root root 13 Apr 8 13:45 libLLVM.so -> libLLVM-15.so*
-rw-r--r-- 1 root root 755K Apr 8 13:45 libLLVMDemangle.a
-rw-r--r-- 1 root root 5.9M Apr 8 13:45 libLLVMSupport.a
-rw-r--r-- 1 root root 1.2M Apr 8 13:45 libLLVMTableGen.a
-rwxr-xr-x 1 root root 121M Apr 8 13:45 libLLVM-15.so*
lrwxrwxrwx 1 root root 13 Apr 8 13:45 libLLVM-15.0.7.so -> libLLVM-15.so*
```

I can see the stddef.h inside build directory:

```
[evan@Evan-Desktop include]$ readlink -f stddef.h
/home/evan/include-what-you-use/build/lib/clang/15.0.7/include/stddef.h
```


notifi...@include-what-you-use.org

unread,
May 25, 2023, 7:17:27 PM5/25/23
to include-wh...@googlegroups.com
Comment #4 on issue 1262 by feux-follets: stddef.h not found
https://github.com/include-what-you-use/include-what-you-use/issues/1262

> Are you also running `include-what-you-use` from the build directory?
>
> If not, we haven't yet figured out how to install IWYU in a sane way. See https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md#how-to-install for details on how to wire it.

I have installed it to another directory and added the directory to PATH.


notifi...@include-what-you-use.org

unread,
May 28, 2023, 12:18:23 PM5/28/23
to include-wh...@googlegroups.com
Comment #5 on issue 1262 by kimgr: stddef.h not found
https://github.com/include-what-you-use/include-what-you-use/issues/1262

OK, in that case you need to make the Clang builtin headers available some other way (easiest is probably to install clang). I'll close this as a duplicate of #100.


Reply all
Reply to author
Forward
0 new messages