Closed alanyangbo closed 3 years ago
Hello,
It seems that there is an issue in the way you are invoking emscripten and that your issue is related to "MSVC / Windows" , since the message "MSVCRTD.lib" show that you are linking against "Microsoft Visual Studio RunTime Debug Library" (MSVCRTD.lib).
When building with emscripten, the msvc compiler and the msvc runtime should not be used: instead you use a compiler provided by emscripten (which is based on clang).
The readme provides instructions for emscripten builds under linux or osx. I just tried them and they do work. However, I did not try them under windows.
Suggestions:
emcmake cmake ..
. I doubt this will work under windows.
Instead you might perhaps use the emscripten dedicated Windows Command Prompt : see https://emscripten.org/docs/tools_reference/emcmdprompt.htmlGood luck
Hello,
It seems that there is an issue in the way you are invoking emscripten and that your issue is related to "MSVC / Windows" , since the message "MSVCRTD.lib" show that you are linking against "Microsoft Visual Studio RunTime Debug Library" (MSVCRTD.lib).
When building with emscripten, the msvc compiler and the msvc runtime should not be used: instead you use a compiler provided by emscripten (which is based on clang).
The readme provides instructions for emscripten builds under linux or osx. I just tried them and they do work. However, I did not try them under windows.
Suggestions:
- Try to build under linux
- Under windows: refer to the documentation concerning windows on the emscripten website. Under linux, one can type
emcmake cmake ..
. I doubt this will work under windows. Instead you might perhaps use the emscripten dedicated Windows Command Prompt : see https://emscripten.org/docs/tools_reference/emcmdprompt.htmlGood luck
Thanks a lot.
The signature of Demo main() function is exactly int main(int argc, char **argv) and returns an int. //----------------------------- 37>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 37>C:\GUI\Imgui\hello_imgui-master\build_emscripten\src\hello_imgui_demos\hello_imgui_demo_minimal\Debug\hello_imgui_demo_minimal.exe : fatal error LNK1120: 1 unresolved externals 39>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 39>C:\GUI\Imgui\hello_imgui-master\build_emscripten\src\hello_imgui_demos\hello_world\Debug\hello_world.exe : fatal error LNK1120: 1 unresolved externals 40>MSVCRTD.lib(exe_main.obj) : error LNK2019: unresolved external symbol main referenced in function "int cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 40>C:\GUI\Imgui\hello_imgui-master\build_emscripten\src\hello_imgui_demos\hello_imgui_demo_classic\Debug\hello_imgui_demo_classic.exe : fatal error LNK1120: 1 unresolved externals