Error -> bash: ./emcc . . .

16 views
Skip to first unread message

João Carlos

unread,
Nov 11, 2022, 8:13:57 PM11/11/22
to emscripten-discuss
I installed Emscripten on Linux Debian 10 and followed the installation step by step according to the link.

But when I run the command (./emcc -v) to see the version I get the following message in the terminal ( bash: ./emcc: No such file or directory ) ?

I also did the environment test by hanging around the command in the terminal ( ./emcc --check ) and I get the following message ( bash: ./emcc: No such file or directory ) ?

I tried to make a compilation using the command ( emcc test -o test.html ) compiling only the file ( test.wasm ) and generating the error in the terminal:

error: undefined symbol: htons (referenced by $inetPton6__deps: ['htons','$jstoi_q'], referenced by $writeSockaddr__deps: ['$Sockets','$inetPton4','$inetPton6','$zeroMemory'], referenced by __syscall_recvfrom__deps: ['$getSocketFromFD','$writeSockaddr','$DNS','$SYSCALLS'], referenced by top-level compiled C/C++ code)
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _htons may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: ntohs (referenced by $inetNtop6__deps: ['$inetNtop4','ntohs'], referenced by $readSockaddr__deps: ['$Sockets','$inetNtop4','$inetNtop6','ntohs'], referenced by $getSocketAddress__deps: ['$readSockaddr','$FS','$DNS'], referenced by __syscall_sendto__deps: ['$getSocketFromFD','$getSocketAddress','$SYSCALLS'], referenced by top-level compiled C/C++ code)
warning: _ntohs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '/home/aguiar/emsdk/node/14.18.2_64bit/bin/node /home/aguiar/emsdk/upstream/emscripten/src/compiler.js /tmp/tmptufh6kbr.json' failed (returned 1)

How can I solve ?

Sam Clegg

unread,
Nov 14, 2022, 6:28:28 PM11/14/22
to emscripte...@googlegroups.com
On Fri, Nov 11, 2022 at 5:13 PM João Carlos <jocm....@gmail.com> wrote:
I installed Emscripten on Linux Debian 10 and followed the installation step by step according to the link.

But when I run the command (./emcc -v) to see the version I get the following message in the terminal ( bash: ./emcc: No such file or directory ) ?

I also did the environment test by hanging around the command in the terminal ( ./emcc --check ) and I get the following message ( bash: ./emcc: No such file or directory ) ?

The commands that start with `./` are designed to be run from the emscripten directory itself.   If you use emcc or otherwise have emcc in your PATH then you can/should just type `emcc --check` (without the leading `./`).
 

I tried to make a compilation using the command ( emcc test -o test.html ) compiling only the file ( test.wasm ) and generating the error in the terminal:

error: undefined symbol: htons (referenced by $inetPton6__deps: ['htons','$jstoi_q'], referenced by $writeSockaddr__deps: ['$Sockets','$inetPton4','$inetPton6','$zeroMemory'], referenced by __syscall_recvfrom__deps: ['$getSocketFromFD','$writeSockaddr','$DNS','$SYSCALLS'], referenced by top-level compiled C/C++ code)
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _htons may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: ntohs (referenced by $inetNtop6__deps: ['$inetNtop4','ntohs'], referenced by $readSockaddr__deps: ['$Sockets','$inetNtop4','$inetNtop6','ntohs'], referenced by $getSocketAddress__deps: ['$readSockaddr','$FS','$DNS'], referenced by __syscall_sendto__deps: ['$getSocketFromFD','$getSocketAddress','$SYSCALLS'], referenced by top-level compiled C/C++ code)
warning: _ntohs may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
emcc: error: '/home/aguiar/emsdk/node/14.18.2_64bit/bin/node /home/aguiar/emsdk/upstream/emscripten/src/compiler.js /tmp/tmptufh6kbr.json' failed (returned 1)

How can I solve ?

This could be a dependency issue with our system libraries, but its hard to tell from the information you have provided. 

In the `emcc test -o test.html` command you mention what is `test`?  Is it a source file or an object file?    Can you share the source code?

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/ba4b0942-19f4-41b2-9eb4-d9e366c001ean%40googlegroups.com.

João Carlos

unread,
Nov 16, 2022, 8:57:30 AM11/16/22
to emscripten-discuss
-o test.html -> Specifies that we want Emscripten to generate an HTML page to run our code in (and a filename to use), as well as the wasm module and the JavaScript "glue" code to compile and instantiate the wasm so it can be used in the web environment.
Reply all
Reply to author
Forward
0 new messages