Command line error D8021: invalid numeric argument '/Wno-warn-absolute-paths' with Visual Studio 2010

1,908 views
Skip to first unread message

Ishaan Venkatesan

unread,
Feb 8, 2015, 2:20:35 AM2/8/15
to emscripte...@googlegroups.com
Hello there,

I was using Visual Studio 2010 & Emscripten 1.29.0 on a Windows 8 machine to run a simple helloworld.cpp application, and it generated the .JS file correctly. But when I tried a more complex application (ZLIB), I got the following error:

2>  ClCompile:
2>    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I"C:\Temp\ZLIB" /I"C:\Temp\ZLIB-build" /nologo /W1 /WX- /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\"" /D zlib_EXPORTS /D _WINDLL /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"zlib.dir\Debug\\" /Fd"zlib.dir\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:queue ..\ZLIB\adler32.c ..\ZLIB\compress.c ..\ZLIB\crc32.c ..\ZLIB\deflate.c ..\ZLIB\gzio.c ..\ZLIB\inffast.c ..\ZLIB\inflate.c ..\ZLIB\inftrees.c ..\ZLIB\trees.c ..\ZLIB\uncompr.c ..\ZLIB\zutil.c  -Wno-warn-absolute-paths -s ALLOW_MEMORY_GROWTH=1 -s ASSERTIONS=1 --memory-init-file 0 -g 
2>cl : Command line error D8021: invalid numeric argument '/Wno-warn-absolute-paths' [C:\Temp\ZLIB-build\zlib.vcxproj]
2>  Done Building Project "C:\Temp\ZLIB-build\zlib.vcxproj" (default targets) -- FAILED.
2>  Done Building Project "C:\Temp\ZLIB-build\ALL_BUILD.vcxproj" (default targets) -- FAILED.

I am pretty new to Emscripten development. Any thoughts on how to fix the error? Thanks!

Floh

unread,
Feb 8, 2015, 5:21:45 AM2/8/15
to emscripte...@googlegroups.com
This is an error from the Visual Studio compiler (cl.exe) not the emscripten compiler wrapper (emcc). The Visual Studio compiler complains about an option that's normally handed to the emscripten compiler. I haven't used the VStudio integration, but I think VS must be told somewhere to use the emscripten platform (somewhere in the configuration manager, where you usually select Win32 or Win64).

Cheers,
-Floh.

Ishaan Venkatesan

unread,
Feb 8, 2015, 10:57:01 AM2/8/15
to emscripte...@googlegroups.com
Hi Floh,

Actually I did set the tool chain to emscripten platform in Visual Studio, and was able to get a simpler example to work earlier. Maybe I should consider using Linux or Mac to do the Emscripten developement?

Jukka Jylänki

unread,
Feb 8, 2015, 12:22:12 PM2/8/15
to emscripte...@googlegroups.com
Like Floh mentions, your Visual Studio project is somehow set up to invoke the Visual Studio compiler and not the Emscripten compiler. Perhaps the Configuration build targets are somehow mixed. You'll know that Emscripten compiler is correctly invoked if it prints to the log 'emcc.bat' instead of 'cl.exe' as the compiler executable.

If Visual Studio does not play nice, you can also use Emscripten compiler from command line on Windows, like you can do for Linux and Mac. Visual Studio is not required for Emscripten development on Windows. If you are looking to set up a build system for your project, CMake is a popular one that is supported by Emscripten on all platforms. If you use Linux or Mac, there exists some amount of autoconf/configure emulation, but that may require project specific configuration depending on the libraries in question.

--
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.
For more options, visit https://groups.google.com/d/optout.

Floh

unread,
Feb 9, 2015, 7:01:15 AM2/9/15
to emscripte...@googlegroups.com
What I do is that I have a portable code base which can be compiled as a native desktop application in VStudio on Windows or in Xcode for OSX. Most of my development happens there, compiling, testing and debugging the native application in VStudio or Xcode. For emscripten and some other target platforms (NaCl, Android...) I compile on the command line. Most bugs happen in the platform-agnostic code and are already found and fix while debugging the native application.

As jj writes, cmake is a good meta-build system for this approach since it generates project files for VStudio or Xcode, as well as Makefiles for command line compilation.

Also, let me shamelessly plug my own cmake wrapper build system 'fips' which makes this switching between target platforms even easier:

http://floooh.github.io/fips/

Check out the progress videos in the github project videos to get an idea how it is used:

https://github.com/floooh/fips/

And my 'weekend 3D engine' using fips as build system:

https://github.com/floooh/oryol

Cheers,
-Floh.
Reply all
Reply to author
Forward
0 new messages