I usually program on a native Linux machine and don't really have any dependency issues. I recently wanted to make a program for Linux and Windows and I went to compile it in WSL using x86_64-mingw32-g++ (downloaded using apt install x86_64-mingw32-g++
) when i run the program I get the following error:
Asked
Active
Viewed 27 times
0

Breadleaf
- 161
- 4
-
1You either need to get and distribute the dll with the executable or statically link the program so that it doesn't need the dll. In this case I'd go with static linking. The executable will be much larger, but the dynamically linked executable plus the dll file will probably be bigger. And some dick could replace the dll and turn your program into a robotic killing machine. All you probably need to do is add `-static` to the command line. – user4581301 Jun 16 '22 at 23:03
-
I added `-static` to the command and it still produces that exact same error error :( – Breadleaf Jun 16 '22 at 23:29
-
Shoot. what does your build command look like? – user4581301 Jun 16 '22 at 23:30
-
@user4581301 `x86_64-w64-mingw32-g++ -static main.cpp` Do note that i am using wsl and using the version I downloaded with apt. – Breadleaf Jun 16 '22 at 23:32
-
Only thing I'd change on that would be to move `-static` to the end, but I can't remember if the order is supposed to matter. – user4581301 Jun 16 '22 at 23:34
-
It still produces an error ; _ ; – Breadleaf Jun 16 '22 at 23:35
-
Is the output file much, much larger than it used to be? – user4581301 Jun 16 '22 at 23:36
-
omg... I forgot. My code uses the final executable called say.exe. when we were debugging i forgot to add `-o say.exe` so the whole time ive been running say.exe. the code works now. thank you! – Breadleaf Jun 16 '22 at 23:37