Changes between Version 9 and Version 10 of CompilationGuide/MSVC


Ignore:
Timestamp:
Nov 2, 2015, 3:25:20 PM (4 years ago)
Author:
saste
Comment:

add extended section about setting the environment

Legend:

Unmodified
Added
Removed
Modified
  • CompilationGuide/MSVC

    v9 v10  
    2424}}}
    2525
    26 To set up a proper environment in MSYS, you need to run `msys.bat` from the Visual Studio or Intel Compiler command prompt.
     26== Setting the environment ==
     27
     28In order to build a program with the VisualStudio tools, you need to setup a proper environment in order to make sure that the configure and build system will be able to find
     29the tools.
     30
     31In particular, the build system will use the `cl` compiler and the `link` linker bundled with the employed version of VisualStudio. In order to setup the enviroment it is so necessary to set the PATH, LIB, and INCLUDE variables to appropriate values.
     32
     33This can be done by launching a cmd.exe native shell from the VisualStudio GUI. This can be done for example adding a tool from the Tools menu:
     34{{{ Tools -> External tools... -> Add }}}
     35
     36To set up a proper environment in MSYS, you need to run `msys.bat` (or the equivalent `mingw32_shell.bat`) from the command prompt.
     37
     38Now, make sure that the `cl` and `link` program are not override by other programs with the same name from MSYS/MinGW (in particular, note that MinGW provides a program named `link`). In order to do so, you can set the MSYS path so that the VisualStudio tools are used instead, for example with the command:
     39{{{
     40export PATH="c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN/":$PATH
     41}}}
     42
     43or removing or renaming the `link` binary provided by MSYS.
    2744
    2845Next, make sure any other headers and libs you want to use, such as zlib, are located in a location that the compiler can see. Do so by modifying the `LIB` and `INCLUDE` environment variables to include the Windows-style paths to these directories. Alternatively, you can try and use the `--extra-cflags`/`--extra-ldflags` configure options.
     46
     47
     48== Build ==
    2949
    3050Finally, run: