leaningtech / cheerp-meta

Cheerp - a C/C++ compiler for Web applications - compiles to WebAssembly and JavaScript
https://labs.leaningtech.com/cheerp
Other
1.03k stars 51 forks source link

Any "__config" include is not finding features.h header #88

Closed aricooperman closed 5 years ago

aricooperman commented 5 years ago

I have a C++ file including , using both an Ubuntu 16 and Windows 10 build host, and using both the 2,0 release and building it from source (pulled on 2/22) all fail with same issue:

Windows:

C:\cheerp\bin\clang++.exe -target cheerp -cheerp-mode=wasm -cheerp-wasm-loader=test.js -O2 -o xxx_wasm.wasm xxx_wasm.cpp
In file included from xxx_wasm.cpp:5:
In file included from C:\cheerp\bin/../include/c++/v1\string:453:
C:\cheerp\bin/../include/c++/v1\__config:350:10: fatal error: 'features.h' file not found
#include <features.h>

Ubuntu:

/opt/cheerp/bin/clang++ -target cheerp -cheerp-mode=wasm -cheerp-wasm-loader=test.js -O2 -o xxx_wasm.wasm xxx_wasm.cpp
In file included from xxx_wasm.cpp:5:
In file included from /opt/cheerp/bin/../include/c++/v1/string:453:
/opt/cheerp/bin/../include/c++/v1/__config:350:10: fatal error: 'features.h' file not found
#include <features.h>

Error is same for 2.0 release and recent build from source

alexp-sssup commented 5 years ago

What headers are being included before <string>? most probably one of them is defining something invalid, most probably the __linux__ macro.

alexp-sssup commented 5 years ago

Can you test with a stripped down file like this:

#include <string>

void webMain()
{
}
aricooperman commented 5 years ago

What headers are being included before <string>? most probably one of them is defined something invalid, most probably the __linux__ macro.

You are right, we had a __linux__ define before, when I reverse order it includes fine. Thanks!