skvadrik / re2c

Lexer generator for C, C++, Go and Rust.
https://re2c.org
Other
1.06k stars 169 forks source link

fatal error: stdlib.h: No such file or directory #476

Closed michacassola closed 4 months ago

michacassola commented 4 months ago

I am trying to build re2c with Autotools with GitHub Actions: Build repo: https://github.com/unypkg/re2c Latest run: https://github.com/unypkg/re2c/actions/runs/8741186605/job/23986620028 (Tried to copy what I found here: https://github.com/skvadrik/re2c/blob/3.1/.github/workflows/ci-autotools.yml)

I get the following error many times building the partial re2c:

/pkg/gcc/13.2.0/include/c++/13.2.0/cstdlib:79:15: fatal error: stdlib.h: No such file or directory
   79 | #include_next <stdlib.h>
      |               ^~~~~~~~~~

Yes gcc is supposed to be in that folder for unypkg and I have successfully compiled many programs in my unypkg environment. Any hints on how to go about this problem would be very welcome!

michacassola commented 4 months ago

I needed to put /uny/pkg/gcc/13.2.0/include/c++/13.2.0 with the correct stdlib.h before /uny/pkg/glibc/2.39/include with the wrong stdlib.h in the CPLUS_INCLUDE_PATH variable.

skvadrik commented 4 months ago

Glad you've figured it out!