-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
When crosscompiling a project with using C++ interop (with importcpp) on Linux (targeting Windows with mingw), nim uses the wrong compiler (g++ instead of x86_64-w64-mingw32-g++).
The compilation then fails due to various import errors (missing Windows headers...)
Example
nimble --accept -d:mingw --cpu:amd64 -o:$(TARGET_NAME).exe cpp $(MAIN_SOURCE)
Output
Error: execution of an external compiler program '/usr/bin/g++ -c [...]
Possible Solution
By replacing my command with :
nimble --accept -d:mingw --cpu:amd64 --gcc.cpp.exe=x86_64-w64-mingw32-g++ --gcc.cpp.linkerexe=x86_64-w64-mingw32-g++ -o:$(TARGET_NAME).exe cpp $(MAIN_SOURCE)
the compilation works.
Additional Information
- I used choosenim to install nim, and I use nimble for my project
- My version :
$ nim -v
Nim Compiler Version 1.0.6 [Linux: amd64]
Metadata
Metadata
Assignees
Labels
No labels