Page 1 of 1

wxmsw294u_gcc_custom.dll

Posted: Thu Apr 18, 2013 10:40 am
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

Re: wxmsw294u_gcc_custom.dll

Posted: Thu Apr 18, 2013 7:24 pm
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

Re: wxmsw294u_gcc_custom.dll

Posted: Fri Apr 19, 2013 12:10 am
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:

Re: wxmsw294u_gcc_custom.dll

Posted: Fri Apr 19, 2013 10:27 am
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

Re: wxmsw294u_gcc_custom.dll

Posted: Mon Apr 22, 2013 11:20 am
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..

Re: wxmsw294u_gcc_custom.dll

Posted: Wed May 01, 2013 7:27 am
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