About Monkey 2 › Forums › Monkey 2 Programming Help › MSVC Community 2017
This topic contains 3 replies, has 2 voices, and was last updated by
Hezkore
1 year, 3 months ago.
-
AuthorPosts
-
December 24, 2017 at 2:53 am #12433
I’m having some problems getting Monkey 2 to compile with the newer MSVC stuff.
I’ve got this installed:

I grab Monkey 2 from the Github development branch.
I edit ‘env_windows.txt’ and change ‘MX2_USE_MSVC=1’ along with ‘MX2_ARCH_WINDOWS=x64’
Then I run ‘rebuildall2go.bat’
And then I get error:ActionScript1234567891011121314151617181920212223***** Rebuilding mx2cc *****Mx2cc version 1.1.08***** Making module 'monkey' *****Parsing...Semanting...Translating...Compiling...Build error: System command 'cl -c -EHs -W0 -MT -utf-8 -O2 -DNDEBUG -I"G:/tools/Monkey2/modules/" -I"G:/tools/Monkey2/modules/monkey/native" -Fo"G:/tools/Monkey2/modules/monkey/monkey.buildv1.1.08/windows_release_msvc/build/monkey_0monkey.cpp.obj" "G:/tools/Monkey2/modules/monkey/monkey.buildv1.1.08/windows_release_msvc/src/monkey_monkey.cpp"' failed.cl -c -EHs -W0 -MT -utf-8 -O2 -DNDEBUG -I"G:/tools/Monkey2/modules/" -I"G:/tools/Monkey2/modules/monkey/native" -Fo"G:/tools/Monkey2/modules/monkey/monkey.buildv1.1.08/windows_release_msvc/build/monkey_0monkey.cpp.obj" "G:/tools/Monkey2/modules/monkey/monkey.buildv1.1.08/windows_release_msvc/src/monkey_monkey.cpp"'cl' is not recognized as an internal or external command,operable program or batch file.***** Fatal mx2cc error *****Internal mx2cc build errorSo okay, it doesn’t find “cl” apparently.
I have a look at ‘MX2_MSVC_PATH_X64’ in ‘env_windows.txt’ and it points me to:
“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\Hostx64\x64”
Which looks like this for me:

And “cl.exe” IS there.
I’ve checked all the other MSVC paths too, like “C:\Program Files (x86)\Windows Kits\10” and they all seem to exist as well.What am I doing wrong?
In the end, I’d like to make this portable so I don’t have to install and go through this on every machine I use.
And I’m wondering, does Monkey 2 actually check the ‘env_windows.txt’ path for ‘cl.exe’, or does it just call the command ‘cl.exe’ which uses “PATH” or something?December 24, 2017 at 10:14 pm #12445Please post your env_windows.txt file.
December 25, 2017 at 12:53 am #12447ActionScript123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169'Use msvc 2017 community edition (mainly for x64 support, but it's also the latest/greatest).'MX2_USE_MSVC=1'Build architecture: x86 or x64, x64 only working with msvc.'MX2_ARCH_WINDOWS=x64'Semi-colon separated list of module root dirs, relative to MX2_HOME or absolute.''mx2cc always adds local modules/ dir to start of list.''MX2_MODULE_DIRS=modules;modules_ext'If you change anything below, you should rebuild all!'***** WINDOWS DESKTOP TARGET - MINGW *****'Note: Requires MinGW compilers+build tools, see: http://monkeycoder.co.nz/monkey2-files.''(Note: TDM GCC not recommended, as it uses SJLJ exceptions which are very slow)'PATH=${MX2_HOME}\devtools\i686-6.2.0-posix-dwarf-rt_v5-rev1\mingw32\bin;${PATH}'Need this to override installed mingw.'GCC_EXEC_PREFIX='Linker optionsMX2_LD_OPTS_WINDOWS=-s -static -m32MX2_LD_OPTS_WINDOWS_DEBUG=MX2_LD_OPTS_WINDOWS_RELEASE='C Compiler options. Note: -D_WIN32_WINNT=0x0601 means headers for Windows 7, ie: Windows 7 is min SDK!MX2_CC_OPTS_WINDOWS=-std=gnu99 -D_WIN32_WINNT=0x0603 -m32MX2_CC_OPTS_WINDOWS_DEBUG=-OsMX2_CC_OPTS_WINDOWS_RELEASE=-O3 -DNDEBUG'C++ Compiler optionsMX2_CPP_OPTS_WINDOWS=-std=c++11 -D_WIN32_WINNT=0x0603 -m32MX2_CPP_OPTS_WINDOWS_DEBUG=-OsMX2_CPP_OPTS_WINDOWS_RELEASE=-O3 -DNDEBUG'***** WINDOWS DESKTOP TARGET - MSVC *****'directoriesMX2_MSVC_DIR=${ProgramFiles(x86)}\Microsoft Visual Studio\2017\Community\VCMX2_MSVC_TOOLS_DIR=${MX2_MSVC_DIR}\Tools\MSVC\14.12.25827MX2_WINDOWS_KITS_DIR=${ProgramFiles(x86)}\Windows Kits\10MX2_WINDOWS_KIT=10.0.16299.0'Linker optionsMX2_LD_OPTS_MSVC=MX2_LD_OPTS_MSVC_DEBUG=MX2_LD_OPTS_MSVC_RELEASE=MX2_CC_OPTS_MSVC=-EHs -W0 -MT -utf-8MX2_CC_OPTS_MSVC_DEBUG=-O1MX2_CC_OPTS_MSVC_RELEASE=-O2 -DNDEBUG'C++ Compiler optionsMX2_CPP_OPTS_MSVC=-EHs -W0 -MT -utf-8MX2_CPP_OPTS_MSVC_DEBUG=-O1MX2_CPP_OPTS_MSVC_RELEASE=-O2 -DNDEBUG'assembler optsMX2_AS_OPTS_MSVC=-DBOOST_CONTEXT_EXPORT='***** MSVC X86 PATHS *****MX2_MSVC_PATH_X86=${MX2_MSVC_TOOLS_DIR}\bin\Hostx86\x86MX2_MSVC_INCLUDE_X86=${MX2_MSVC_TOOLS_DIR}\include;MX2_MSVC_INCLUDE_X86=${MX2_MSVC_INCLUDE_X86}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\ucrt;MX2_MSVC_INCLUDE_X86=${MX2_MSVC_INCLUDE_X86}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\shared;MX2_MSVC_INCLUDE_X86=${MX2_MSVC_INCLUDE_X86}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\um;MX2_MSVC_LIB_X86=${MX2_MSVC_TOOLS_DIR}\lib\x86;MX2_MSVC_LIB_X86=${MX2_MSVC_LIB_X86}${MX2_WINDOWS_KITS_DIR}\Lib\${MX2_WINDOWS_KIT}\ucrt\x86;MX2_MSVC_LIB_X86=${MX2_MSVC_LIB_X86}${MX2_WINDOWS_KITS_DIR}\Lib\${MX2_WINDOWS_KIT}\um\x86;'***** MSVC X64 PATHS *****MX2_MSVC_PATH_X64=${MX2_MSVC_TOOLS_DIR}\bin\Hostx64\x64MX2_MSVC_INCLUDE_X64=${MX2_MSVC_TOOLS_DIR}\include;MX2_MSVC_INCLUDE_X64=${MX2_MSVC_INCLUDE_X64}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\ucrt;MX2_MSVC_INCLUDE_X64=${MX2_MSVC_INCLUDE_X64}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\um;MX2_MSVC_INCLUDE_X64=${MX2_MSVC_INCLUDE_X64}${MX2_WINDOWS_KITS_DIR}\Include\${MX2_WINDOWS_KIT}\shared;MX2_MSVC_LIB_X64=${MX2_MSVC_TOOLS_DIR}\lib\x64;MX2_MSVC_LIB_X64=${MX2_MSVC_LIB_X64}${MX2_WINDOWS_KITS_DIR}\Lib\${MX2_WINDOWS_KIT}\ucrt\x64;MX2_MSVC_LIB_X64=${MX2_MSVC_LIB_X64}${MX2_WINDOWS_KITS_DIR}\Lib\${MX2_WINDOWS_KIT}\um\x64;'***** EMSCRIPTEN TARGET *****'Note: Requires Emscripten SDK, see: https://github.com/juj/emsdk/blob/master/README.md'Add mserver_winnt emscripten mini-server/launcher.'MX2_MSERVER="${MX2_HOME}\devtools\mserver-v86c\mserver_winnt.exe"'Linker optionsMX2_LD_OPTS_EMSCRIPTEN=-s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1MX2_LD_OPTS_EMSCRIPTEN_DEBUG=-s ASSERTIONS=2MX2_LD_OPTS_EMSCRIPTEN_RELEASE='C Compiler optionsMX2_CC_OPTS_EMSCRIPTEN=-std=gnu99 -Wno-all -s -s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1MX2_CC_OPTS_EMSCRIPTEN_DEBUG=-Os -s ASSERTIONS=2MX2_CC_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG'C++ Compiler optionsMX2_CPP_OPTS_EMSCRIPTEN=-std=c++11 -Wno-all -s USE_SDL=2 -s TOTAL_MEMORY=268435456 -s DISABLE_EXCEPTION_CATCHING=1MX2_CPP_OPTS_EMSCRIPTEN_DEBUG=-Os -s ASSERTIONS=2MX2_CPP_OPTS_EMSCRIPTEN_RELEASE=-O3 -DNDEBUG'***** ANDROID TARGET *****'Note: Requires Android Studio + Android NDK, see: https://developer.android.com/studio/index.html'This is where *my* ndk-bundle is located - yours is probably somewhere else!''For android builds, you need to either set this correctly or make sure 'ndk-build' is available from the command line.''PATH=D:\devtools\Android\sdk\ndk-bundle;${PATH}'Controls APP_ABI in Application.mk for NDK'MX2_ANDROID_APP_ABI=armeabi-v7a x86'MX2_ANDROID_APP_ABI=all'Controls APP_PLATFORM in Application.mk for NDK'MX2_ANDROID_APP_PLATFORM=android-14'Android app compiler Compiler flags'MX2_ANDROID_APP_CFLAGS=-std=gnu99 -fno-stack-protector -wMX2_ANDROID_APP_CPPFLAGS=-std=c++11 -fno-stack-protector -frtti -fexceptions -w'Controls version of STL used by android apps.'MX2_ANDROID_APP_STL=c++_static'***** RASPBIAN *****MX2_RASPBIAN_TOOLS=${MX2_HOME}\devtools\SysGCC\Raspberry\bin'Linker optionsMX2_LD_OPTS_RASPBIAN=-s -staticMX2_LD_OPTS_RASPBIAN_DEBUG=MX2_LD_OPTS_RASPBIAN_RELEASE='C Compiler optionsMX2_CC_OPTS_RASPBIAN=-std=gnu99MX2_CC_OPTS_RASPBIAN_DEBUG=-OsMX2_CC_OPTS_RASPBIAN_RELEASE=-O3 -DNDEBUG'C++ Compiler optionsMX2_CPP_OPTS_RASPBIAN=-std=c++11MX2_CPP_OPTS_RASPBIAN_DEBUG=-OsMX2_CPP_OPTS_RASPBIAN_RELEASE=-O3 -DNDEBUGDecember 25, 2017 at 12:57 am #12448I think I’ve managed to get it working… It’s still compiling so not sure, but the ‘cl.exe’ error isn’t showing up at least.
What I did was compile it once without MSVC, which got me the new “mx2cc_windows.exe” compiler.
And after that, MSVC seems to compile just fine. -
AuthorPosts
You must be logged in to reply to this topic.