You are not logged in.
Pages: 1
I have a c++ program that I would like to compile windows binaries for. I have tried installing mingw32-gcc, and using g++, but when I run the binaries (in wine or from windows), I get errors that certain .dll files are not found. Is there additional configuration needed to set up mingw32? Or should I be using a completely separate compiler. Thanks in advance!
Offline
Which .dll files?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Which .dll files?
libgcc_s_sjlj-1.dll
Offline
Well, depending on how you compile, you'll have to get the mingw support DLLs over there too, like libgcc for instance. There must be some documentation on the mingw site for installing apps on Windows.
Offline
Grrr. It used to work on my system (I think). I have a gcc program that uses wxWidgets that I know that I cross compiled and placed on source forge, but I will be darned if I can wake it work now. It is possible that I did it with a Genoo system
I'll get back to you...
Edit: Do me a favor, grab http://sourceforge.net/projects/pdp1spa … p/download and see if it runs for you. That archive contains the mingw10.dll
I promise the file is benign. It is a port of SpaceWar (The first video game ever), which runs on a PDP-1 emulator. The Linux version is in the AUR.
Last edited by ewaller (2012-03-23 03:10:28)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Here is "Hello World"
ewaller@odin:~ 1029 %cd test
ewaller@odin:~/test 1030 %ls
hello.c
ewaller@odin:~/test 1031 %cat hello.c
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
printf ("Hello World\n");
}
ewaller@odin:~/test 1032 %i486-mingw32-gcc hello.c -o hello.exe
ewaller@odin:~/test 1033 %ls
hello.c hello.exe
ewaller@odin:~/test 1034 %wine hello.exe
Hello World
ewaller@odin:~/test 1035 %
Last edited by ewaller (2012-03-23 03:34:46)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Here is "Hello World"
ewaller@odin:~ 1029 %cd test ewaller@odin:~/test 1030 %ls hello.c ewaller@odin:~/test 1031 %cat hello.c #include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { printf ("Hello World\n"); } ewaller@odin:~/test 1032 %i486-mingw32-gcc hello.c -o hello.exe ewaller@odin:~/test 1033 %ls hello.c hello.exe ewaller@odin:~/test 1034 %wine hello.exe Hello World ewaller@odin:~/test 1035 %
Works perfectly, even when substituting g++ for gcc. My problems occur, however, when compiling other things, I don't know why it is different.
[ray@rays-computer programming]$ cd YetiHack/src/
[ray@rays-computer src]$ ls
Makefile YetiHack.cpp yeti.cpp
[ray@rays-computer src]$ i486-mingw32-g++ YetiHack.cpp yeti.cpp -o yetihack.exe -I../include -lpdcurses
[ray@rays-computer src]$ wine yetihack.exe
err:module:import_dll Library libgcc_s_sjlj-1.dll (which is needed by L"Z:\\home\\ray\\Documents\\programming\\YetiHack\\src\\yetihack.exe") not found
err:module:import_dll Library pdcurses.dll (which is needed by L"Z:\\home\\ray\\Documents\\programming\\YetiHack\\src\\yetihack.exe") not found
err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\home\\ray\\Documents\\programming\\YetiHack\\src\\yetihack.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\ray\\Documents\\programming\\YetiHack\\src\\yetihack.exe" failed, status c0000135
[ray@rays-computer src]$
Offline
ewaller@odin:~/test[1] 1040 %locate libgcc_s_sjlj-1.dll
/home/ewaller/Dropbox/libgcc_s_sjlj-1.dll
/home/ewaller/Dropbox/wxwidgetsprojects/spacewar/src/libgcc_s_sjlj-1.dll
/home/ewaller/devel/wxwidgetsprojects/spacewar/src/libgcc_s_sjlj-1.dll
/usr/i486-mingw32/bin/libgcc_s_sjlj-1.dll
/usr/i486-mingw32/lib/libgcc_s_sjlj-1.dll
ewaller@odin:~/test 1041 %pacman -Qo /usr/i486-mingw32/bin/libgcc_s_sjlj-1.dll
/usr/i486-mingw32/bin/libgcc_s_sjlj-1.dll is owned by mingw32-gcc 4.6.2-1
ewaller@odin:~/test 1042 %pacman -Qo /usr/i486-mingw32/lib/libgcc_s_sjlj-1.dll
/usr/i486-mingw32/lib/libgcc_s_sjlj-1.dll is owned by mingw32-gcc 4.6.2-1
ewaller@odin:~/test 1043 %
ewaller@odin:~/test 1054 %locate libstdc++-6.dll
/home/ewaller/Dropbox/libstdc++-6.dll
/home/ewaller/Dropbox/wxwidgetsprojects/spacewar/src/libstdc++-6.dll
/home/ewaller/devel/wxwidgetsprojects/spacewar/src/libstdc++-6.dll
/usr/i486-mingw32/bin/libstdc++-6.dll
/usr/i486-mingw32/lib/libstdc++-6.dll
ewaller@odin:~/test 1055 %pacman -Qo /usr/i486-mingw32/bin/libstdc++-6.dll
/usr/i486-mingw32/bin/libstdc++-6.dll is owned by mingw32-gcc 4.6.2-1
ewaller@odin:~/test 1056 %pacman -Qo /usr/i486-mingw32/lib/libstdc++-6.dll
/usr/i486-mingw32/lib/libstdc++-6.dll is owned by mingw32-gcc 4.6.2-1
ewaller@odin:~/test 1057 %
waller@odin:~/test 1047 %locate pdcurses.dll
ewaller@odin:~/test[1] 1048 %
Edit: Okay, I botched that post.. I'm fixing it.... There, that is better
Edit: The plot thickens...
ewaller@odin:~/test 1070 %pkgfile pdcurses.dll
ewaller@odin:~/test 1071 %
Last edited by ewaller (2012-03-23 04:35:19)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
I had the same problem last time, and the problem seems to be the dynamic link of libraries.
Try to compile a static version. This will result in a larger binary, but it is independent. This works in my case, where the program has to work with serial ports on windows.
I cross-compile it like this
/usr/bin/i486-mingw32-g++ -static-libgcc -static-libstdc++ -L . <code> -o <output.exe>
works even with wine.
Offline
I had the same problem last time, and the problem seems to be the dynamic link of libraries.
Try to compile a static version. This will result in a larger binary, but it is independent. This works in my case, where the program has to work with serial ports on windows.I cross-compile it like this
/usr/bin/i486-mingw32-g++ -static-libgcc -static-libstdc++ -L . <code> -o <output.exe>
works even with wine.
First, the bad news. For me, it doesn't work with wine, possibly a side effect of using pdcurses, but on windows, it works great. Perfectly. Thank you, I don't know what I would have done without you.
Edit: Is there any way to get .dll files I have on hand compiled in to the binary so I don't have to release them as separate files?
Last edited by rh995 (2012-03-26 03:14:20)
Offline
hm, maybe just try pure -L <path/to/your/self-compiled-dll> -static . But I don't know whether this really includes self-written/-compiled .dll files for static compilation.
Offline
I cross-compile it like this
/usr/bin/i486-mingw32-g++ -static-libgcc -static-libstdc++ -L . <code> -o <output.exe>
Thank you very-very much, it works for me.
Last edited by ivan.kolmycheck (2013-03-30 14:49:59)
Offline
Pages: 1