aMule Forum
English => Compilation problems => Topic started by: Stu Redman on May 26, 2009, 08:16:20 PM
-
Played around a bit with building wxGTK 2.8.10 and noticed:
- aMule doesn't build in debug mode with a non-debug wx because wxOnAssert is missing then (configure doesn't complain, only link fails)
- wx doesn't build in debug mode with optimization. I configure it with --enable-debug --enable-optimize and it silently switches optimization off (and builds with -O0) . >:(
So you can't build a aMule debug build with an optimized wx, which is ridiculous. I want to debug aMule, not wx, and I want the full wx speed.
Am I doing something wrong?
-
Played around a bit with building wxGTK 2.8.10 and noticed:
- aMule doesn't build in debug mode with a non-debug wx because wxOnAssert is missing then (configure doesn't complain, only link fails)
Strange, on Mac I build debug aMule with no debug wxMac without problems.
EDIT: Maybe because I use -with-wxdir: my wxMac is not installed and not shared.
- wx doesn't build in debug mode with optimization. I configure it with --enable-debug --enable-optimize and it silently switches optimization off (and builds with -O0) . >:(
I know, try so:
CFLAGS="-O2" CXXFLAGS="-O2" ../configure ...
if you want use the exact flasgs of optimise they should be:
-O2 -fno-strict-aliasing
-
Played around a bit with building wxGTK 2.8.10 and noticed:
- aMule doesn't build in debug mode with a non-debug wx because wxOnAssert is missing then (configure doesn't complain, only link fails)
Check you wx installation. I just built aMule with '--enable-debug --without-wxdebug' without failure. (Yes, I checked that it used the non-debug wx, which was configured as '--enable-optimize --disable-debug'.) (r9623, wx-2.8.10, just for reference)
Am I doing something wrong?
Might be.
-
And, by the way,
topi:~/repos/svn/aMule/trunk$ grep -i -r wxOnAssert
./unittests/tests/.svn/text-base/FormatTest.cpp.svn-base:// Needs reentrant wxOnAssert, which is missing in pre-2.8.8.
./unittests/tests/FormatTest.cpp:// Needs reentrant wxOnAssert, which is missing in pre-2.8.8.
topi:~/repos/svn/aMule/trunk$
aMule doesn't ever directly references wxOnAssert.
Other cause may be that a leftover object from a previous compilation messed up your linkage - run 'make clean' (or equivalent if you're using MSVC) before retrying.
-
Tried it again:
Linking amuleweb
../../libs/ec/cpp/libec.a(ECMuleSocket.o): In function `CECMuleSocketHandler::SocketHandler(wxSocketEvent&)':
/home/martin/aMule/mytrunk/src/libs/ec/cpp/ECMuleSocket.cpp:51: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
/home/martin/aMule/mytrunk/src/libs/ec/cpp/ECMuleSocket.cpp:69: undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
Offending line is wxCHECK_RET(socket, wxT("Socket event with a NULL socket!"));
I've built wx static - maybe that's related to the problem?
-
OK - this does the trick:
../source/configure --enable-unicode --without-subdirs --disable-debug_info --enable-debug_flag --with-gtk --enable-optimize --prefix=/home/stu/aMule/wxGTK-2.8.10/release --disable-shared
So it compiles with -O2, generates no wx debug info but still supports all the wx assert macros.
-
Good, but strange:
maybe wxMac thinks different ...lol :o
Before what configure flags you used?
I use:
--disable-shared \
--enable-unicode \
--with-opengl \
--disable-debug --enable-optimise \
--disable-compat26 \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-regex=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--with-libiconv-prefix=$MACPORTS \
--enable-universal_binary \
--with-macosx-sdk="$SYSROOT" \
--with-macosx-version-min=$OSMIN \
and the only debug that remain enabled is:
--enable-debugreport use wxDebugReport class
maybe?
enterprise:mulo sadmin$ grep debug wxMac-2.8.10_osx-build-10.4-configure.log
checking for --enable-debug... no
checking for --enable-debug_flag... no
checking for --enable-debug_info... no
checking for --enable-debug_gdb... no
checking for --enable-debug_cntxt... no
checking for --enable-debugreport... yes
config.status: creating samples/debugrpt/Makefile
configure: running /bin/sh '../../../src/expat/configure' --prefix=/usr/local '--disable-shared' '--enable-unicode' '--with-opengl' '--disable-debug' '--enable-optimise' '--disable-compat26' '--with-libjpeg=builtin' '--with-libpng=builtin' '--with-regex=builtin' '--with-libtiff=builtin' '--with-zlib=builtin' '--with-expat=builtin' '--with-libiconv-prefix=/opt/local' '--enable-universal_binary' '--with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk' '--with-macosx-version-min=10.4' 'CC=gcc' 'CFLAGS=' 'CXXFLAGS=' 'CXX=g++' --cache-file=/dev/null --srcdir=../../../src/expat
Should wxWidgets be compiled in debug mode? no
enterprise:mulo sadmin$
-
Stu, are you sure that when compiling ECMuleSocket.cpp __WXDEBUG__ wasn't defined? Also that libec.a and ECMuleSocket.o were rebuilt?
-
Stu, are you sure that when compiling ECMuleSocket.cpp __WXDEBUG__ wasn't defined?
I'm sure __WXDEBUG__ was defined:
/* if _DEBUG is defined (MS VC++ and others use it in debug builds), define */
/* __WXDEBUG__ too */
#ifdef _DEBUG
#ifndef __WXDEBUG__
#define __WXDEBUG__
#endif /* !__WXDEBUG__ */
#endif /* _DEBUG */
and we define _DEBUG in our debug build. That's the problem.
Gtoso, before I used only --disable-debug . Yeah, strange how these flags influence each other, especially how optimize is silently turned off. >:(
-
and we define _DEBUG in our debug build. That's the problem.
Not we, but MSVC does. Configure defines __DEBUG__ and the code uses that everywhere. If you can make MSVC not define _DEBUG, it should work.
-
Ah - ok. Well, I'm talking about a Linux build all the time. So that's not the reason. Hmm.
-
Ah - ok. Well, I'm talking about a Linux build all the time. So that's not the reason. Hmm.
Hmm. I did that on Linux, too. You should find out where does that _DEBUG define come from.