| 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 | |
| | 28 | In 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 |
| | 29 | the tools. |
| | 30 | |
| | 31 | In 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 | |
| | 33 | This 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 | |
| | 36 | To set up a proper environment in MSYS, you need to run `msys.bat` (or the equivalent `mingw32_shell.bat`) from the command prompt. |
| | 37 | |
| | 38 | Now, 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 | {{{ |
| | 40 | export PATH="c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN/":$PATH |
| | 41 | }}} |
| | 42 | |
| | 43 | or removing or renaming the `link` binary provided by MSYS. |