I've compiled a small app in Linux (Ubuntu 11.04) with Mingw32 and it runs ok in Wine, but does nothing on Wuindows (although it runs).
Configure:
./configure --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i686-linux
(I've tried without --target
and without --build
with the same results.)
Compile:
i586-mingw32msvc-g++ -DHAVE_CONFIG_H -I. -I.. -DLOG_DOMAIN=\"tpv\" -I.. -DWINVER=0x0400 -D_WINDOWS_ -Wall -g -Wl,--subsystem,console -mconsole -mms-bitfields -g -O2 -MT tpv-excepciones.o -MD -MP -MF .deps/tpv-excepciones.Tpo -c -o tpv-excepciones.o
Link:
/bin/bash ../libtool --tag=CXX --mode=link i586-mingw32msvc-g++ -Wall -g -Wl,--subsystem,console -mconsole -mms-bitfields -g -O2 -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -lodbc32 -ladvapi32 -lodbc32 -lwsock32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid -lmingw32 -Wl,-subsystem,console -o tpv.exe tpv-excepciones.o tpv-conf.o tpv-main.o
It generates an .exe file which is not a linux binary. It runs OK in wine, but does nothing in Windows XP.
Reading the web I've added some flags in configure time:
-Wl,--subsystem,console -mconsole -mms-bitfields
This is the program:
#include <windows.h>
#include "main.hh"
int main (int argc, char ** argv)
{
MessageBox (0, "Joder!", "Ermmm...", MB_OK);
//utils::conf c ("configuracion.3D");
//std::cout << "Valor de 'no': '" << c["TEXTO_ERROR"] << "'" << std::endl;
//std::cout << "..." << std::endl;
return 0;
}
I've tried everything I've found on the web to no avail.
Am I missing something?