Hi,
I installed mingw-64 using mingw-builds. I moved it to standard place:
C:\Prog\nim-0.16.0_x64\nim-0.16.0>where gcc
c:\MinGW\bin\gcc.exe
Nim's finish.exe does not like it:
C:\Prog\nim-0.16.0_x64\nim-0.16.0>finish
bin/nim.exe is already in your PATH [Skipping]
The following *incompatible* MingW installations exist
c:\MinGW\bin
C:\mingw\bin
No compatible MingW candidates found in the standard locations [Error]
1- What is wrong? 2- I am totally new to nim. How can i test whether my installtion is fine?
Success.
@Araq:
C:\>gcc -dumpmachine
i686-w64-mingw32
I ignored the finish.exe and tried to compile the first example in tutorial. The error message is below. Apparently the architecture of the nim and gcc differs.
In file included from C:\tmp\nim\nim\hello\nimcache\stdlib_system.c:9:0:
C:\Prog\nim-0.16.0_x64\nim-0.16.0\lib/nimbase.h:443:13: error: size of array 'Ni
m_and_C_compiler_disagree_on_target_architecture' is negative
typedef int Nim_and_C_compiler_disagree_on_target_architecture[sizeof(NI) == si
zeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So, instead of x64 one, i downloaded nim-0.16.0_x32.zip from http://nim-lang.org/download.html and it works now.
That being said, this is confusing: I am using mingw-64, but the nim binary that works with it is nim..._x32.
This brings a question: What is the architecture of the hello.exe? 32 bit? 64 bit?
@Araq:
C:\Prog\nim-0.16.0_x32\nim-0.16.0>nim -v
Nim Compiler Version 0.16.0 (2017-01-08) [Windows: i386]
Copyright (c) 2006-2017 by Andreas Rumpf
git hash: b040f74356748653dab491e0c2796549c1db4ac3
active boot switches: -d:release
I have another problem now: nimble does not work
C:\Prog\nim-0.16.0_x32\nim-0.16.0>nimble install nimx
could not load: (ssleay32|libssl32).dll
compile with -d:nimDebugDlOpen for more information
I assume this means nimble needs sslaeay32 or libssl32 libraries? How do I install those?
[Windows: i386] means it's 32 bits.
I assume this means nimble needs sslaeay32 or libssl32 libraries? How do I install those?
They are in $nim\bin, next to nimble.exe. I don't know why this issue keeps coming up. Do you install Nim from git or what? You can also get them here http://nim-lang.org/download/dlls.zip
@Araq:
Overriding dll's in the bin directory with the ones you mentioned did the trick.
I was able to run a nimx example, after a little bit sttrugle.
I am documenting that struggle, may be it will be helpful to others:
I needed to install git, too.
At some point I restarded cmd as administrator.
Also a couple of times nimble crushed and restarting the command solved the problem.
So, it seems like i was able to install nimx.
I tried to run the first example in nimx web page https://github.com/yglukhov/nimx , but i get another error:
main.nim(18, 1) Error: tabulators are not allowed
Replaced tabs with spaces, and that was solved.
Then it could not find sdl2.dll, which i downloaded from internet, and put to project directory, and that was also fixed.
I may have restarted the compiler once or twice.
At the end I saw a "Hello World" GUI program!
Thanks.
Actually, I had another problem:
For nimx tests, you need nake.
But I could not install it:
C:\Windows\system32>nimble install nake
Downloading https://github.com/fowlmouth/nake using git
Warning: File inside package 'nake' is outside of permitted namespace, should
be named 'nake.nim' but was named 'nakelib.nim' instead. This will be an error
in the future.
Hint: Rename this file to 'nake.nim', move it into a 'nake\' subdirectory,
or prevent its installation by adding `skipFiles = @["nakelib.nim"]` to the .ni
mble file. See https://github.com/nim-lang/nimble#libraries for more info.
Verifying dependencies for [email protected]
Warning: No nimblemeta.json file found in C:\Users\oguz\.nimble\pkgs\closure_
compiler-0.2
Warning: No nimblemeta.json file found in C:\Users\oguz\.nimble\pkgs\jsbind-0
.1
Installing [email protected]
Building nake/nake.exe using c backend
Warning: Binary 'nake.exe' was already installed from source directory. Will
be overwritten.
Traceback (most recent call last)
nimble.nim(1073) nimble
nimble.nim(999) doAction
nimble.nim(608) install
nimble.nim(466) installFromDir
tools.nim(87) copyFileD
os.nim(1290) copyFileWithPermissions
os.nim(592) copyFile
os.nim(153) raiseOSError
Error: unhandled exception: The system cannot find the file specified.
[OSError]
tracked here: https://github.com/nim-lang/Nim/issues/10088 building from source on windows: instructions lack necessary details and lead to errors #10088
see https://github.com/nim-lang/Nim/issues/10088#issuecomment-449787627 for the most reliable way I found, by simply patching %APPDATA%nimnim.cfg