Discussion:
[Mingw-w64-public] use tdm-gcc to compile wx2.9.4, get i386:x86-64 architecture of input file incompatible error
zhangxinghai
2013-05-31 03:57:15 UTC
Permalink
hello
I try to build 32-bit wx2.9.4 with tdm-gcc.
My os:windows xp (32bit) 5.1.2600
I download tdm-gcc from
http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm64-gcc-4.7.1-3.exe/download
I cd wx\build\msw directory and invoke command
../../configure --build=x86_64-w64-mingw32 --host=i686-w64-mingw32 --enable-shared --disable-debug
--disable-monolithic --enable-unicode CXXFLAGS="-pipe -m32 fno-keep-inline-dllexport -Os"
LDFLAGS=-m32 CFLAGS=-m32

I get the error
ld.exe: i386:x86-64 architecture of input file `basedll_version_rc.o' is incompatible
with i386 output
Where is wrong?
Another question is if I use mingw32-make,how do I specify --build,--host and --target parameter,such as
replace --enable-unicode with UNICODE=1
Thanks
Ruben Van Boxem
2013-05-31 05:34:52 UTC
Permalink
Post by zhangxinghai
hello
I try to build 32-bit wx2.9.4 with tdm-gcc.
My os:windows xp (32bit) 5.1.2600
I download tdm-gcc from
http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm64-gcc-4.7.1-3.exe/download
Post by zhangxinghai
I cd wx\build\msw directory and invoke command
../../configure --build=x86_64-w64-mingw32 --host=i686-w64-mingw32
--enable-shared --disable-debug
Post by zhangxinghai
--disable-monolithic --enable-unicode CXXFLAGS="-pipe -m32
fno-keep-inline-dllexport -Os"
Post by zhangxinghai
LDFLAGS=-m32 CFLAGS=-m32
I get the error
ld.exe: i386:x86-64 architecture of input file `basedll_version_rc.o' is incompatible
with i386 output
Where is wrong?
Another question is if I use mingw32-make,how do I specify --build,--host
and --target parameter,such as
Post by zhangxinghai
replace --enable-unicode with UNICODE=1
Thanks
It is better to use the same host as build with MSYS, no need confusing the
build script into crosscompiling when you're not... Really.

For make, you need to check the makefile and the build documentation to see
what is possible.

Ruben
------------------------------------------------------------------------------
Post by zhangxinghai
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Mingw-w64-public mailing list
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
zhangxinghai
2013-05-31 07:13:05 UTC
Permalink
Hi,Ruben
I think I must use --build and --host.If not,first I will get cannot guess build type error.
The tdm-gcc is built with --build=x86_64-w64-mingw32,So I set build type to that.
I want to build the wx dlls which are used under 32bit windows xp os.
So I set host type to i686-w64-mingw32
I think I'm performing a cross compiling,Is that right?
Thanks.
Ruben Van Boxem
2013-05-31 08:33:39 UTC
Permalink
Post by zhangxinghai
Hi,Ruben
I think I must use --build and --host.If not,first I will get cannot
guess build type error.
The tdm-gcc is built with --build=x86_64-w64-mingw32,So I set build type to that.
I want to build the wx dlls which are used under 32bit windows xp os.
So I set host type to i686-w64-mingw32
I think I'm performing a cross compiling,Is that right?
Technically yes, practically it's better to make the configure script
believe you're on 32-bit Windows.

I am capable of running

../wxwidgets-2.9.4/configure --host=i686-w64-mingw32
make

but it ends up with the same problem.

I have rebuilt this with my GCC 4.7.4 build, and it works just fine.

I believe we have an auto-import bug in either GCC 4.8 or binutils trunk.
The GCC 4.7.4 build used the binutils 2.23.2 release, whereas the 4.8.0
build still used trunk 2.23.52.20130322.

Ruben


Thanks.
Post by zhangxinghai
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________
Mingw-w64-public mailing list
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
John E. / TDM
2013-05-31 13:41:41 UTC
Permalink
Post by zhangxinghai
I try to build 32-bit wx2.9.4 with tdm-gcc.
*snip*
Post by zhangxinghai
I get the error
ld.exe: i386:x86-64 architecture of input file
`basedll_version_rc.o' is incompatible
with i386 output
Where is wrong?
This indicates that windres generated a 64-bit .o file from
version.rc, which is incompatible with the 32-bit DLL you're trying to
create. In addition to the "-m32" flag to GCC, you need to specify "-F
pe-i386" as a windres-specific flag.

I don't know if wxWidgets' configury is capable of adding this flag or
not -- you might try adding it to "RCFLAGS" and see what happens.
Post by zhangxinghai
Another question is if I use mingw32-make,how do I specify
--build,--host and --target parameter,such as
replace --enable-unicode with UNICODE=1
When using mingw32-make, you are expected to use
build/msw/makefile.gcc, which assumes enough about your system that
--build, --host and --target are no longer necessary. The remainder of
the flags may be passed as environment variables. The
building-on-Windows README (I forget its filename) has details on how
to do this. Using mingw32-make and makefile.gcc, I was able to
successfully build 32-bit wxWidgets DLLs, but only after modifying
makefile.gcc by hand myself to utilize the RCFLAGS variable, and then
adding "-F pe-i386" into RCFLAGS.

This discussion thread may provide some useful info:
<http://forums.wxwidgets.org/viewtopic.php?f=19&t=36817>

-John E. / TDM

Loading...