error: ‘_O_BINARY’ undeclared (first use in this function); did you mean ‘O_BINARY’?
1222 | _setmode(T1_, _O_BINARY);
What does gcc -v say? Mine says "gcc version 8.1.0 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)"
Here is the complete output:
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-msys/9.3.0/lto-wrapper.exe
Target: x86_64-pc-msys
Configured with: /msysdev/gcc/src/gcc-9.3.0/configure --build=x86_64-pc-msys --prefix=/usr --libexecdir=/usr/lib --enable-bootstrap --enable-shared --enable-shared-libgcc --enable-static --enable-version-specific-runtime-libs --with-arch=x86-64 --with-tune=generic --disable-multilib --enable-__cxa_atexit --with-dwarf2 --enable-languages=c,c++,fortran,lto --enable-graphite --enable-threads=posix --enable-libatomic --enable-libgomp --disable-libitm --enable-libquadmath --enable-libquadmath-support --disable-libssp --disable-win32-registry --disable-symvers --with-gnu-ld --with-gnu-as --disable-isl-version-check --enable-checking=release --without-libiconv-prefix --without-libintl-prefix --with-system-zlib --enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible --enable-libstdcxx-filesystem-ts
Thread model: posix
gcc version 9.3.0 (GCC)
msys is not a supported environment for the same reason we don't support cygwin. Use the mingw64 environment when building Nim instead (when msys is installed it also creates a shortcut to open it's mingw shell, use that instead).
Thank you very much !
1- Does mingw64 have a package manager (like pacman or apt-get)?
2- Where should I get it (what URL)?
MSYS2 comes with a MinGW environment. You should be able to access it using the shortcuts created by the MSYS2 installer in the Start Menu. MSYS2's pacman can be used to install packages for mingw (see here for more information).
Thank you!
Here is a distrbution of Mingw 64 which does the trick:
1. Version of mingw used:
http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20200720.exe
2. Version of gcc installed (with pacman):
https://packages.msys2.org/base/mingw-w64-gcc
3. Version of openSSL installed (necessary for "Nimble"):
https://packages.msys2.org/package/mingw-w64-x86_64-openssl
pacman -S mingw-w64-x86_64-openssl
You can also unzip the Windows version from here and run finish.exe:
Thank you!
That's what I had done in the first place, but I was hoping that a version of Nim built from source, via a Mingw, would make it easier for me to install Nimble packages which require external C libraries, such as Neo which requires blas.dll, for instance, or others which use gui libs like fltk, etc. I was hoping to be able to manage Nim, Neo, and all the required ext libs in one place, basically.
Erratum: I finally managed to make use of the Neo package as well: using the following switch to select the openblas lib installed:
nim c -d:blas=libopenblas myTest.nim