Linker Error wx3.2 + TDM-GCC 10.3 Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
Rob'
Experienced Solver
Experienced Solver
Posts: 68
Joined: Mon Dec 08, 2008 10:10 pm

Linker Error wx3.2 + TDM-GCC 10.3

Post by Rob' »

I am using TDM-GCC 10.3 and the Windows binaries. When I try to build a simple 32 bit app, I get the following error
x86_64-w64-mingw32-g++.exe -Lc:\dev\wxWidgets-3.2.0\lib\gcc103TDM_dll -o bin\Debug\Test32.exe obj\Debug\GUIFrame.o obj\Debug\Test32App.o obj\Debug\Test32Main.o obj\Debug\resource.res -mthreads -m32 -lwxmsw32ud_core -lwxbase32ud -mwindows
C:/dev/TDM-GCC-10.3/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `obj\Debug\resource.res' is incompatible with i386 output
What else do I have to set here?

Thanks in advance.
Rob'
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by ONEEYEMAN »

Hi,
You need to download the source code of the library, unpack it to e.g. c:\wxWidgets-3.2 and then do the following:

1. Open Command Prompt
2. Execute "cd c:\wxWiodgets-3.2\build\msw"
3. Execute "mingw32-g++ -f makefile.gcc BUILD=debug SHARED=0"
4. Go to your program directory
5. Compile it with appropriate include and lib search options.

You will just save yourself a lot of headache.

In terms of your question - nothing. You downloaded the libraries for an incompatible architecture.

Thank you.
Rob'
Experienced Solver
Experienced Solver
Posts: 68
Joined: Mon Dec 08, 2008 10:10 pm

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by Rob' »

Thanks for your replay, but I guess you can see the question mark over my head. I have downloaded and installed:
- TDM-GCC 10.3
- from the wx download page the Windows binaries for TDM-GCC 10.3 (header and development files)

With TDM-GCC I can build 32 and 64 bit applications. It depends on the flag "-m32" or "-m64" ("-m64" is default). I have testet that with a simple console app.
Why I have to build the wx ibraries by myself? And what is the "incompatible architecture"?

Rob'
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by doublemax »

i386:x86-64 architecture of input file `obj\Debug\resource.res' is incompatible with i386 output
This means that resource.res is a 64bit file.

I don't use MinGW, but AFAIK there is an external tool called windres.exe to build the resource file. Did you tell it to create a 32bit file?
https://stackoverflow.com/questions/188 ... -for-32bit
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by ONEEYEMAN »

Rob,
First off - only Debug DLL build is available, not Release and not static.
Second - building yourself guarantees full compatibility with the OS you develop on and so then creation distribution installer.

If you are ok with those 2 points above...

Thank you
Rob'
Experienced Solver
Experienced Solver
Posts: 68
Joined: Mon Dec 08, 2008 10:10 pm

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by Rob' »

@doublemax:
This means that resource.res is a 64bit file.
That was my guess.
Did you tell it to create a 32bit file?
And that was the question. The help shows this:
windres: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf32-iamcu elf64-little elf64-big elf32-little elf32-big pe-bigobj-i386 srec symbolsrec verilog tekhex binary ihex plugin
Which of these should I use?

@ONEEYEMAN:
First off - only Debug DLL build is available, not Release and not static.
That is not correct. The are binaries for debug and release builds available.
Second - building yourself guarantees full compatibility with the OS you develop on and so then creation distribution installer.
Hmm. That would mean that binaries were generated on a different machine are useless.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7480
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by ONEEYEMAN »

Hi,
Rob' wrote: Sun Jul 17, 2022 12:57 pm
First off - only Debug DLL build is available, not Release and not static.
That is not correct. The are binaries for debug and release builds available.
.

But there is no static build available, only DLL.
Second - building yourself guarantees full compatibility with the OS you develop on and so then creation distribution installer.
Hmm. That would mean that binaries were generated on a different machine are useless.
I didn't say that.
What I meant was that there might be some incompatibility between the machine that binaries was made and yours.
There was a post here not long ago where the user complained about the linking issue.
Turns out it was different setting between build and that user machine.
Please see a note about older version of MinGW64 in the docs.


I unfortunately don't remember the details, but probably doublemax will.

Thank you.
Last edited by ONEEYEMAN on Sun Jul 17, 2022 1:16 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by doublemax »

Rob' wrote: Sun Jul 17, 2022 12:57 pm And that was the question. The help shows this:
windres: supported targets: pe-x86-64 pei-x86-64 pe-bigobj-x86-64 elf64-x86-64 elf64-l1om elf64-k1om pe-i386 pei-i386 elf32-i386 elf32-iamcu elf64-little elf64-big elf32-little elf32-big pe-bigobj-i386 srec symbolsrec verilog tekhex binary ihex plugin
Which of these should I use?
Did you check the link i posted?
Use the source, Luke!
Rob'
Experienced Solver
Experienced Solver
Posts: 68
Joined: Mon Dec 08, 2008 10:10 pm

Re: Linker Error wx3.2 + TDM-GCC 10.3

Post by Rob' »

That solves the problem, now it works. The required option is -F pe-i386. Thank you, doublemax.

@ONEEYEMAN:
Yes, there are only the versions for non-static builds available. We've been using this for some time and have never had any problems with it.

Thank you again.
Post Reply