Is there any guide which shows you how to change the compiler you're using on windows, i.e. how to install a different one to Mingw?
Background: I ask because I have gotten stuck on an exception trying to load bitmap files with the stb_image library. It was suggested that I use a different compiler to see if it resolves anything. I installed nim with choosenim stable. I have thus Mingw as the default. I've no idea how to go about switching.
You can change C/C++ backend compiler with --cc option. https://nim-lang.org/docs/nimc.html#compiler-selection
For example, --cc:vcc use cl.exe in MS Visual Studio. --cc:clang use clang.
If you want to use different gcc, add following option to your cfg file.
gcc.exe = "c:\\path\\to\\your\\gcc.exe"
I currently use Nim to program on Windows and leave 3 different compilers to use: MinGW (gcc), LLVM (clang) and TinyCC (tcc).
To use them is simple, type at the command line to compile the source code nim: nim c --cc:<gcc|clang|tcc> nimsource.nim
However, first you need to enter some settings in config/nim.cfg:
@if windows:
gcc.path = r"D:/mingw64/bin"
tcc.path = r"D:/tcc64"
clang.path = r"D:/LLVM64/bin"
@end
Nowadays I don't use Microsoft's Visual C ++/Visual Studio (vcc), but to use it just open the "Native Tools Command Prompt for VS 2019" and compile nim source code with: nim c --cc:vcc nimsource.nim