Monday, February 23, 2015

Using nim with Visual C++ as the C compiler

Like everything else in Nim, its pretty straight forward. All you have to do is set the compiler to vcc in the config file - nim.cfg. The config file resides in a sub-directory called config under the Nim installation location. The default install location of Nim on windows is c:\Nim

Once you've set the C compiler, open a command prompt and set the environment variables up using the command as follows -

"c:\Program Files (x86)\Microsoft Visual Studio 14.0\vc\vcvarsall.bat" x64

You can omit the x64 bit at the end if you are interested in building 32 bit code.

That's it.

After that you can compile your nim programs using the usual nim c file.nim

No comments:

Post a Comment