wxmsw294u_gcc_custom.dll 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
vayth
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Apr 03, 2013 10:28 am

wxmsw294u_gcc_custom.dll

Post by vayth »

Hi,

I have an error while compiling wxwidget with

Code: Select all

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
and get

Code: Select all

c:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe:
gcc_mswudll\monodll_textentry.o: bad reloc address 0x4 in section `.data'
collect2.exe: error: ld returned 1 exit status
makefile.gcc:5086: recipe for target `..\..\lib\gcc_dll\wxmsw294u_gcc_custom.dll' failed
mingw32-make: *** [..\..\lib\gcc_dll\wxmsw294u_gcc_custom.dll] Error 1

I see some people have some problem with wxmsw gcc dll too, like here and here, but doesn't seem to get an answer. the best one is recompile using static, but is there the only way? is that mean I can't use dynamic in the future?

Thanks before
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: wxmsw294u_gcc_custom.dll

Post by eranif »

vayth wrote:the best one is recompile using static, but is there the only way? is that mean I can't use dynamic in the future?
I am building wx294 in DLL. however, I am not using the 'MONOLITHIC' option since it does not work well with MinGW.
Instead use the 'Multi lib' option, true it will create more DLLs instead of one big monolithic DLL, but it works...

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
vayth
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Apr 03, 2013 10:28 am

Re: wxmsw294u_gcc_custom.dll

Post by vayth »

Thanks for the reply..

Unfortunately, I still get the same error..

Code: Select all

c:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe: gcc_mswudll\coredll_textentry.o: bad reloc address 0x4 in section `.data'
collect2.exe: error: ld returned 1 exit status
makefile.gcc:5143: recipe for target `..\..\lib\gcc_dll\wxmsw294u_core_gcc_custom.dll' failed
mingw32-make: *** [..\..\lib\gcc_dll\wxmsw294u_core_gcc_custom.dll] Error 1
Also, I tried to build it statically, wx build successfully, yet I can't compile the sample program at all...

any other suggestion? :cry:
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: wxmsw294u_gcc_custom.dll

Post by eranif »

Have you tried using another toolchain? i.e. replace your MinGW installation?
What really puzzels me is that you are using mingw32-make (and the installation name is C:\MinGW32) however, your ld.exe is from the W64 toolchain, which usually implies MinGW64

Is it possible that you are mixing toolchains here?

If you don't mind changing toolchain, why don't you try the stable TDM-GCC ? http://tdm-gcc.tdragon.net/download (this is the one I am using)

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
vayth
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Apr 03, 2013 10:28 am

Re: wxmsw294u_gcc_custom.dll

Post by vayth »

sorry for delayed reply.. went to a place without internet connection for two days..

I renamed that folder.. the default is just 'mingw', without 32.
I have a folder named mingw already, which contains mingw-w64 for targeting 64 bit. But since I got 0x0007b error (I forgot the precise error text) which said I have a wrong architecture target, I downloaded another mingw-w64 that targeting 32 bit.


with mingw-w64 (32 bit target), I manage to successfully build wx only if I didn't use parameter; only mingw32-make -f makefile.gcc
I've tried:
shared=1 mono=1 -> fail
shared=1 mono=0 -> fail
shared=0 mono 1 -> fail (expected, I guess..)
shared=0 mono 0 -> success, but always fail while linking build.
shared=0 mono 0 CXXFLAGS=-fno-keep-inline-dllexport -> success (which I assume the same as the default without parameter, since build.cfg is written like that)

But even now, I can't still build a simple program successfully.

Code: Select all

c:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe: C:\wxWidgets-2.9.4\lib\gcc_lib/libwxmsw29u_core.a(corelib_textentry.o): bad reloc address 0x4 in section `.data'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 7 seconds)
0 errors, 0 warnings (0 minutes, 7 seconds)
 
0 error.. I think that bad reloc is the cause, but I don't know what to do

anyway, I've tried TDM GCC that came with orwellDev-Cpp, (64 bit one). It also failed.
But maybe I'll try download TDM 32 bit one and see if I can build a shared or mono build..
vayth
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Apr 03, 2013 10:28 am

Re: wxmsw294u_gcc_custom.dll

Post by vayth »

You're right, it's the toolchain problem.
I don't know what's the problem with other compiler I've tried, but it finally works with TDM GCC 4.7.1-2

Thanks for the help
Post Reply