cimgui-sokol-starterkit icon indicating copy to clipboard operation
cimgui-sokol-starterkit copied to clipboard

cannot open file '.obj' emscripten, win10, vs2022

Open AleCie opened this issue 2 years ago • 1 comments

Is it some issue on my end?

C:\Development\C++\cimgui-sokol-starterkit\wasm>cmake --build .
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  cimgui.vcxproj -> C:\Development\C++\cimgui-sokol-starterkit\wasm\Debug\libcimgui.a
  sokol.vcxproj -> C:\Development\C++\cimgui-sokol-starterkit\wasm\Debug\libsokol.a
LINK : warning LNK4044: unrecognized option '/-default-obj-ext'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/-shell-file'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\de
mo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sNO_FILESYSTEM=1'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sASSERTIONS=0'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\
demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/sMALLOC=emmalloc'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wa
sm\demo.vcxproj]
LINK : warning LNK4044: unrecognized option '/-closure=1'; ignored [C:\Development\C++\cimgui-sokol-starterkit\wasm\dem
o.vcxproj]
LINK : fatal error LNK1104: cannot open file '.obj' [C:\Development\C++\cimgui-sokol-starterkit\wasm\demo.vcxproj]

AleCie avatar Mar 13 '22 13:03 AleCie

The issue seems to be that cmake has generated MSVC project files (which it does by default on Windows), but with Emscripten command line options (I haven't tested Emscripten builds on Windows as I wrote in the readme).

Maybe emcmake needs to be told to explicitely generate makefiles, e.g.:

emcmake cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ..

But TBH, even if this works, it's likely that you'll run into more issues with the Emscripten SDK on Windows. Might be better to build for the Emscripten target inside WSL.

floooh avatar Mar 19 '22 15:03 floooh