Header files not found : error thrown by emscripten

287 views
Skip to first unread message

MONISHA

unread,
Oct 20, 2023, 11:44:30 AM10/20/23
to emscripten-discuss
Hello,
When trying to convert cyclictest.c to a wasm file, some errors were popping up. I was trying to find out the reason. Like emscripten which compiles the c code to wasm, that is not reading the header files that are specific to linux from the C library. Also header files related to POSIX is not read by emscripten.

Can anyone suggest how this issue of emscripten compiler not reading the header files that are present in the C library can be solved? 

Sam Clegg

unread,
Oct 23, 2023, 2:28:35 PM10/23/23
to emscripte...@googlegroups.com
Can you share the specific errors you are seeing?

In general emscripten supports all/most POSIX headers but does *not* support linux-specific headers.  i.e. if your library compiles on macOS and linux it should also compile with emscripten.

cheers,
sam

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/104996b0-14f6-4430-a48e-8614700c7055n%40googlegroups.com.

MONISHA

unread,
Oct 25, 2023, 2:04:48 PM10/25/23
to emscripten-discuss
Screenshot.PNG
Hi Sam,
This was the error I was facing with. Emcc is not reading this linux specific header file. So, what I did is I copied the header file from the C library and copied were my code is present. When I did like that I was not getting error in that linux header file, but error was thrown in other header files like "bitsperlong.h" etc. This was the issue.
I tried converting C file to wasm using emcc in linux only. 

Best regards,
Monisha T

Brion Vibber

unread,
Oct 25, 2023, 4:12:18 PM10/25/23
to emscripten Mailing List
Beware that emscripten is not Linux; a Linux -specific header file will not be useful for compiling to the emscripten platform.

You should find out why your program wants to use this file, and make sure it doesn't try.

Possibly the program's build system thinks you are building for Linux and it is wrong, but has a way to tell it you have another target (or perhaps emconfigure was not used on the configure script, and you just need that?)

Or possibly the program/library simply is hard coded for Linux and needs to be modified.

-- brion


Reply all
Reply to author
Forward
0 new messages