Hello everyone!
Operating system:
Linux 2.6.32-gentoo-r5 #1 SMP x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @
2.40GHz GenuineIntel GNU/Linux
Version of Wine:
wine-1.1.40
I am trying to run an application I wrote which compiles and runs fine
using MinGW but when I try to make a WineLib version of it I get the
error -
wine: Bad EXE format for P:\CMS\cms.exe
Here is a transcript of the session.
First I build a DLL the application needs:
$ make
wrc -r -Iinc -I/usr/include/wine/windows -o resource.o resource.rc
wineg++ -O2 -fno-strength-reduce -fno-strict-aliasing -g -Iinc
-I../include -I/usr/include/wine/windows -Dlinux -D__amd64__
-D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE
-D_SVID_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -c -o
src/tis.o src/tis.cpp
+ wineg++ -o ./libdbgtrace.so.~ -shared --dll dbgtrace.spec
-Wl,-soname,libdbgtrace.so. resource.o src/tis.o
$ file libdbgtrace.so.~.so
libdbgtrace.so.~.so: ELF 32-bit LSB shared object, Intel 80386, version
1 (SYSV), dynamically linked, not stripped
This apparently works OK.
Then I build the application:
$ make
wrc -r -I./inc -I/usr/include/wine/windows -DWINELIB -D_REENTRANT
-DDEBUG -o resource.res resource.rc
wineg++ -O2 -fno-strength-reduce -fno-strict-aliasing -g -mwindows
-std=c++0x -Wall -I. -Iinc -I../include -I/usr/include/wine/windows
-Dlinux -D__amd64__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE
-D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DWINELIB -D_REENTRANT -DDEBUG -c -o src/main.o
src/main.cpp
rm -f cms
wineg++ -o cms -O2 -fno-strength-reduce -fno-strict-aliasing -g
-L/usr/lib32/wine resource.res src/main.o -lws2_32 -lcomctl32
-L../dbgtrace -ldbgtrace.so.~
$ file cms.exe.so
cms.exe.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV),
dynamically linked, not stripped
This also appears to work, but when I run the app by changing to the
shared object's folder and invoke the .exe (which is really a shell
script), I get the following:
$ LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH wine ../CMS/cms.exe
wine: Bad EXE format for P:\CMS\cms.exe
I'm sure I've done something wrong, forgotten a flag or something...
Anyone know what is wrong?
J