Good morning
This is my first time install nim on my windows 10 development laptop. I have copied the necessary dll's and also downloaded the mingw64 compiler.
Firstly, to make a simple program compile and run in windows 10 I had to include my gcc path manually here:
@end
@end
However, I cannot seem to run this command to build for macos: nim -d:release --os:macosx --cpu:amd64 c hello.nim
This is the error generated? what else must I change in the nim.cfg file? Error: invocation of external compiler program failed. The system cannot find the file specified. Additional info: "Requested command not found: 'clang.exe -c -w -O3
Hi, thank you so much for the reply. I have since installed Virtual Box and installed latest UBUNTU desktop iso... trying to fire up Visual Studio Code, Nim and the LLVM binaries ... struggling to set the path to CLANG.
If it IS in fact possible to cross compile to MACOSX, ANDROID etc. FROM windows 10 i would like to stick to Windows 10 - purely due to my decades of working primary on windows ...
This is 'greek' to me at this stage "compile toolchain for GCC setup to make that configuration work."
Is it possible to compile for MAC OSX on windows 10 when compiling a NIM program - or must i install UBUNTU?
I don't guarantee it will work, but there's a chance. I believe I managed to get it to cross-compile from Windows to Android once.
https://github.com/arnetheduck/nlvm https://github.com/miyabisun/docker-nim-cross
I have never cross-compiled from Windows/Linux => OSX but given my experience going the other way, I will recommend first finding an existing C/C++ compiler setup that does that for you before trying within Nim.
https://github.com/tpoechtrager/osxcross is the only real link I have found and it is only for Linux => OSX.
Thank you everyone! Great, I have a virtual box up with latest UBUNTU desktop installed. Managed to compile easy to Linux (ubuntu) no issues Also , managed to use mingw-w64 to compile an exe for windows Now, still playing with a way to compile to MacOS - I got a binary file compiled but cannot bash run it or mac os ...?
Good Evening Thank you for all the replies!
I have decided to push on with a new UBUNTU desktop installation in VirtualBOX (host is Windows 10). I managed to get it up and running in the UBUNTU desktop.
Compiling
well, try this:
chmod +x hello
./hello
and also show output of file hello command
Hi I have tried to run the macos binary - that I compile using Ubuntu and this is what happens :-(
chmod +x hello ** this runs fine - no errors
./hello
cannot execute binary file :-(
You can try using this Docker image. It supports cross compiling directly, but you can also look at how the Docker image is setup to get more info about how you might do it yourself.
hang on it works! I opened up terminal - navigate to Desktop (cd Desktop) where I copied the ...osx.bin file.
Then I simply executed it like this ./hello64.osx.bin !!! and the echo message appeared - no errors.