How to set program name/argument 0 (argv[0]
) with emcc
? For example, emcc hello.c -o hello.html
with --set-name main
*.
This is not the same as setting Module.arguments
(which changes arguments 1 and up, I want argument 0).
- in auto-generated
hello.js
, there isvar thisProgram="./this.program"
. Changing directly givesUncaught TypeError: str.charCodeAt is not a function
- using
Module["thisProgram"]="./main";
in--pre-js
givesUncaught TypeError: str.charCodeAt is not a function
This is for web (with .html
), so renaming hello.js
to main.js
does not work (it is still ./this.program
).
main
is just a placeholder. It will be something other than the default./this.program
.