aMule Forum

English => Compilation problems => Topic started by: NiKo87 on December 18, 2006, 01:17:30 PM

Title: Error using wxWidgets 2.8.0
Post by: NiKo87 on December 18, 2006, 01:17:30 PM
Hi, I'm trying to compile aMule 2.1.3 with the patch on the homepage using the wxWidgets 2.8.0 but I get this error:

echo './'`MuleTrayIcon.cpp; \
then mv -f ".deps/amule-MuleTrayIcon.Tpo" ".deps/amule-MuleTrayIcon.Po"; else rm -f ".deps/amule-MuleTrayIcon.Tpo"; exit 1; fi
/Users/MaMaK/Desktop/wxWidgets-2.8.0/include/wx/gdicmn.h: In member function 'bool wxRect::Inside(int, int) const':
/Users/MaMaK/Desktop/wxWidgets-2.8.0/include/wx/gdicmn.h:486: warning: declaration of 'y' shadows a member of 'this'
/Users/MaMaK/Desktop/wxWidgets-2.8.0/include/wx/gdicmn.h:486: warning: declaration of 'x' shadows a member of 'this'
MuleTrayIcon.cpp: In member function 'void CMuleTrayIcon::SetTrayIcon(int, uint32)':
MuleTrayIcon.cpp:258: error: no matching function for call to 'wxMemoryDC::SelectObject(wxIcon&)'
/Users/MaMaK/Desktop/wxWidgets-2.8.0/include/wx/dcmemory.h:30: note: candidates are: void wxMemoryDCBase::SelectObject(wxBitmap&)
make[3]: *** [amule-MuleTrayIcon.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I'm using Mac OS X 10.4.8 with the latest version of XCode.
Title: Re: Error using wxWidgets 2.8.0
Post by: lionel77 on December 18, 2006, 05:53:07 PM
You are not the first one to run into this problem. ;)

It's fixed in current aMule CVS code but if you really want to compile 2.1.3 against wx 2.8.0, you need to open MuleTrayIcon.cpp and at line 258 and change:
IconWithSpeed.SelectObject(CurrentIcon);
to
IconWithSpeed.DrawIcon(CurrentIcon, 0, 0);

One word of caution though, when you compile aMule against a recent version of wx (e.g., 2.8.0) then there will be most likely two bugs:
- the labels & icons in the preferences will be associated with the wrong categories
- none of the graphs are drawn (e.g., on the statistics page)

If you want, you can try to help me bug people enough so that those two issues get fixed. ;)
/me waves at phoenix
Title: Re: Error using wxWidgets 2.8.0
Post by: NiKo87 on December 18, 2006, 08:27:51 PM
Thanks, now it works! ;)
Title: Re: Error using wxWidgets 2.8.0
Post by: NiKo87 on December 18, 2006, 10:24:30 PM
If I compile the wxWidgets using --enable-universal_binary I get this error:

/usr/bin/ld: warning libs/common/libmulecommon.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning libs/ec/libec.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning ./libmuleappcore.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: warning ./libmuleappgui.a archive's cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (can't load from it)
/usr/bin/ld: Undefined symbols:
_main
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccp5hBen.out (No such file or directory)
make[3]: *** [amule] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Is it normal?
Title: Re: Error using wxWidgets 2.8.0
Post by: lionel77 on December 19, 2006, 05:59:54 AM
Yeah, aMule is still a pain in the ass to compile as Universal Binary. Do you really need a universal version or were you just playing with that --enable-universal-binary switch?
Title: Re: Error using wxWidgets 2.8.0
Post by: NiKo87 on December 19, 2006, 10:17:49 AM
I would like to compile a universal binary version on my MacBook to use it on my iMacG5. But it's not a problem if it doesn't work. I'll compile amule directly on my iMac. Thanks ;)
Title: Re: Error using wxWidgets 2.8.0
Post by: lionel77 on December 19, 2006, 03:01:13 PM
Actually, I just remembered that I already posted some basic instruction for compiling aMule as Universal Binary here (http://forum.amule.org/thread.php?postid=62635#post62635). Please let me know if you need any additional help.