Making MSVC portable

About Monkey 2 Forums Monkey 2 Programming Help Making MSVC portable


This topic contains 19 replies, has 6 voices, and was last updated by  Mark Sibly 7 months, 1 week ago.

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
  • #10406


    UPDATE: This now works perfectly fine.
    So feel free to use this.

    • Original post:
      I move between a lot of computers, and I generally don’t like things that places files all over my computer.
      And MSVC has always caused a lot of trouble for me when it comes to this.
      So I’ve tried to get it portable by just copying the needed stuff into the Monkey 2 ‘devtools’ folder and edit the env txt.
      I’ve got it working, but there’s an annoying problem with it only working with ‘fresh’ compiles.
      Basically, you can compile once with MSVC in Ted2Go, but if you edit the code and try to compile again, it’ll complain about g++ not existing.
      Perhaps anyone can help me with that?
    • Portable MSVC:
      You can grab my portable MSVC pack over at:
      All you have to do it unpack it in your ‘devtools’ folder and set the path in ‘env_windows.txt’
      Here’s a simple 3 step guide, with an easy copy-paste config for ‘env_windows.txt’:

    Mark Sibly

    The MSVC version still needs g++ to generate dependancies, so you’ll need this in devtools too.



    Alright, I’ve figured it out.
    Turns out I forgot ;${PATH} at the very end! 🙂


    Mark Sibly

    Is your bin/env_windows.txt file correct, or have you set system PATH to mingw binaries?

    Can you dump bin/env_windows.txt file here, along with full path to devtools.



    Sorry Mark
    Read my previous post, I’ve updated it 🙂


    Mark Sibly

    Turns out I forgot ;${PATH} at the very end!




    I get the following error:


    Mx2cc version 1.1.06

    ***** Making module ‘assimp’ *****

    c:\monkey2-v1.1.06\modules\assimp\assimp\contrib\zlib\gzguts.h(29): fatal error C1083: Cannot open include file: ‘unistd.h’: No such file or directory
    Build error: System command ‘cl -c -EHs -W0 -MT -Ox -DNDEBUG -I”C:/Monkey2-v1.1.06/modules/” -I”C:/Monkey2-v1.1.06/modules/monkey/native” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/include/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/code/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/unzip/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/irrXML/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/rapidjson/include/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/openddlparser/include/” -Fo”C:/Monkey2-v1.1.06/modules/assimp/assimp.buildv1.1.06/windows_release_msvc/build/_1_1_1assimp_2contrib_2zlib_2gzclose.c.obj” “C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/zlib/gzclose.c”‘ failed.

    cl -c -EHs -W0 -MT -Ox -DNDEBUG -I”C:/Monkey2-v1.1.06/modules/” -I”C:/Monkey2-v1.1.06/modules/monkey/native” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/include/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/code/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/unzip/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/irrXML/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/rapidjson/include/” -I”C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/openddlparser/include/” -Fo”C:/Monkey2-v1.1.06/modules/assimp/assimp.buildv1.1.06/windows_release_msvc/build/_1_1_1assimp_2contrib_2zlib_2gzclose.c.obj” “C:/Monkey2-v1.1.06/modules/assimp/assimp/contrib/zlib/gzclose.c”

    Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24210 for x86

    Copyright (C) Microsoft Corporation. All rights reserved.



    ***** Fatal mx2cc error *****

    Internal mx2cc build error

    Update modules failed.
    Total time elapsed: 0 m 0 s.



    That doesn’t seem to be related to my portable MSVC since ‘unistd.h’ comes with emscripten and mingw.
    Make sure you have the Mingw-6.2.0 build tools for Windows along with Emscripten-1.37.9 build tools for Windows if you’re trying to compile for those.
    You can find those under ‘Files’ here on the this webpage, though Mark hasn’t updated the links names to this webpage so you’ll have to correct that yourself heh.


    Mark Sibly

    This has been fixed in more recent versions of monkey2. There’s a new binary build on its way – this week sometime for sure!


    Simon Armstrong

    As MSVC user I got a bit confused with upgrading monkey2 until the penny dropped that I would need to change some paths in common.bat to have _msvc suffix



    @hezkore thanks for your prepared version!

    I tried to repack files into 7z format and I got 252 mb, in zip it is 752 mb.

    But… Less size + MORE expensive extraction time = small profit (or not).


    I think it would be good to have precompiled msvc-ish version on



    Yeah I did also pack it into 7z heh, problem was that I didn’t know if people actually use 7zip or if they just use the default Windows zip extractor, in which case they can’t open Rar or 7z.
    So I just kept it as a Zip file to be sure everyone could use it. 🙂

    You can probably clean the content up a bit if you know what M2 actually uses from MSVC, I have no idea though so I just left everything in it.

    I think if the version contains MSVC, it’d be a very big download and I don’t know if people would like that. 😮
    One thing you could do though is perhaps make a Ted2Go option where you can turn MSVC ‘on’, and if it doesn’t detect MSVC it downloads the zip (or 7z?) and extracts it into the ‘devtool’ folder for the user.
    So people who want to use it can easily get it installed, but it’ll take a bit to download.



    Maybe 7z compression by SFX format (self extracting).



    I tried optimizing the MSVC folder a bit, everything still compiles fine (at least on my machine)
    You can probably cut out some other stuff too if you know what you’re doing.
    I also made another attempt at compressing it and managed to get it down to about 50mb.

    It’s using the SFX format, so here’s an “installer”/self extracting version of it:

    I’ve updated the instructions, and the old zip version is still there (See first post)



    Very nice file size. 🙂

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic.