as i am running windows 7 not linux.
resetting windows installation to be able to compile correctly : because i have tried few setups and installations and path in environment variables got messed with to many of the variations of TDM-GCC MinGW + Mingw-w64. and 2 versions of nim x86 and x64
so as a start, i am going to uninstall ALL - compilers and sdk's and clean the path in system variables .
question is when starting clean:
so bottom line on "virgin" windows = no gcc no mings no nim from the Nim download page : should i download both 32 and 64 bit ?
i am running on win7 os x64 all i need is to be able to compile both x86 and x64 versions of dll Separately
what are the steps of download what is the command line to compile ?
i guess :
- download x64 wich has a Mingw-w64 checkbox to include its installation
this is after considering the comment of the download page that recommends to Download it http://nim-lang.org/download.html
- in command line after all is set up correctly :
# is this to much or this is the proper way # to distinguish between the two options # as i guess the x64 is the default executable whether it's a .dll or .exe nim c --app:lib -d:release --cpu:i386 --os:windows --passC:-m32 --passL:-m32 test.nim default nim c --app:lib -d:release test.nim works as it is now but produces only the x64 version of dll thanks for your time !
the first link on linux was not relevant but googling
sizeof(void*) && NIM_INTBITS == sizeof(NI)*8
brought me to
http://forum.nim-lang.org/t/602
so is this still a problem ?
proc return_size_void(): int= sizeof(RootObj) echo return_size_void() nim c --cpu:i386 --os:windows -r testnimaporia.nim
One thing that we like to do is have a separate nimcache directory when compiling between 32 and 64 bits. For example, in your nim.cfg file you can have something like
@if release:
@putenv "debug_dll" ""
@else
@putenv "debug_dll" "_d"
@end
@if arch64:
cpu = "amd64"
@putenv "bits" "64"
@else
cpu = "i386"
@putenv "bits" "32"
@end
out %= "mydll$bits$debug_dll.dll"
nimcache %= "nimcache$bits$debug_dll"
We pass -d:arch64 or -d:arch32 on the command line and that (along with whether -d:release has been passed), gives us
- mydll32.dll with the cache folder as nimcache32
- mydll32_d.dll with the cache folder as nimcache32_d
- mydll64.dll with the cache folder as nimcache64
- mydll64_d.dll with the cache folder as nimcache64_d
I'm not 100% sure if having the cache folders separated like that is really needed or not, but even on clean builds, it is fast enough that it hasn't been an issue for us.
this is a good idea, i have implemented it via seperated dirs and sepearated .nim files
so i have Nim\projName\x64 & Nim\projName\x86
and each has test64.nim & test32.nim
so when i compile i have totally separated projects and compilations, the difference is that maybe in the solution you recommend the directions to the compiler are more explicit and it does what you tell it to.
and i did not try those switch -d:arch32
G:\RobDev\Documents\Visual Studio 2010\Projects\CPP_Interaction\Nim\testNewCfg>nim c -d:release -d:arch32 --app:lib testnimAtom.nim Hint: system [Processing] Hint: testnimatom [Processing] CC: testnimatom CC: system In file included from g:\robdev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\testnimatom.c:9:0: G:\RobDev\ProgramsDev\Nim-0.12.0\lib/nimbase.h:412:13: error: size of array 'assert_numbits' is negative typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; ^ In file included from g:\robdev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\system.c:9:0: G:\RobDev\ProgramsDev\Nim-0.12.0\lib/nimbase.h:412:13: error: size of array 'assert_numbits' is negative typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; ^ Hint: [Link] gcc.exe: error: g:\robdev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\system.o: No such file or dire ctory gcc.exe: error: g:\robdev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\testnimatom.o: No such file or directory gcc.exe: fatal error: no input files compilation terminated. Error: execution of an external program failed: 'gcc.exe -shared -o "g:\robdev\documents\visual studio 2010\projects\cpp_interaction\n im\testnewcfg\mydll32.dll" "g:\robdev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\system.o" "g:\rob dev\documents\visual studio 2010\projects\cpp_interaction\nim\testnewcfg\nimcache32\testnimatom.o" ' G:\RobDev\Documents\Visual Studio 2010\Projects\CPP_Interaction\Nim\testNewCfg>