vs-tool icon indicating copy to clipboard operation
vs-tool copied to clipboard

VS on XP can't find emcc.bat for linking

Open MarkCallow opened this issue 11 years ago • 2 comments

When I try to build my VS 2010 project with the default installation setup, compiles work but links fail with an error like

"Can't find C:/Program"

For some reason the part of VS that invokes the linker is confused by spaces in the path name in $EMSCRIPTEN. I tried both '/' and '' as path separators since when it first failed on XP I was using '' but it was working on Windows 7 which was using '/'. However it fails on XP with either.

My fix has been to set EMSCRIPTEN to the DOS short-form path which does not have spaces with

setx EMSCRIPTEN $(cygpath -d -m "$EMSCRIPTEN")

[You need cygwin to do the above. I have no idea how to obtain the DOS short-form with a Windows command.]

This gives a path like

C:/PROGRA~1/EMSCRI~1/EMSCRI~1/172EFD~1.8

MarkCallow avatar Nov 25 '13 06:11 MarkCallow

Perhaps the way could be to detect that the current OS is Windows XP and in that case, have python generate short paths for all env. vars that have spaces in them.

Did you have to fix this only for the EMSCRIPTEN env. var so that Visual Studio gets it right, or were there issues with other env. vars/invocations as well?

juj avatar Nov 26 '13 11:11 juj

Only for EMSCRIPTEN and only for the link step and only on Windows XP. It is very strange.

MarkCallow avatar Nov 27 '13 02:11 MarkCallow