aMule Forum

English => Compilation problems => Topic started by: Gerd78 on January 18, 2011, 09:29:21 PM

Title: Building aMule on openSUSE >= 11.4
Post by: Gerd78 on January 18, 2011, 09:29:21 PM
There are two important changes for aMule users in openSUSE 11.4.

The first is that cryptopp will be included in the distribution, so you can just use the "libcryptopp-devel" package from the distribution and don't need to build it yourself anymore.

The second is that wxWidgets is now built with --enable-stl by default (more info (http://lists.opensuse.org/opensuse-factory/2011-01/msg00213.html)). aMule does not currently work with this. This means that you must build aMule against the "wxWidgets-wxcontainer-devel" package and not "wxWidgets-devel".
Title: Re: Building aMule on openSUSE >= 11.4
Post by: macias on March 07, 2011, 03:35:14 PM
Thank you for the info.

How did you deal with lib(g)upnp ? aMule looks for libupnp, however the library in repo is named libgupnp.

Thank you in advance.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on March 07, 2011, 07:15:51 PM
aMule does not currently work with this. This means that you must build aMule against the "wxWidgets-wxcontainer-devel" package and not "wxWidgets-devel".
What does "not work"? Is it something that can be fixed?
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 07, 2011, 09:10:49 PM
If this can help :.....
Compiling aMule 2.3.1 RC1 with "wxWidgets-devel" :

Quote
Compiling MuleDebug.cpp
MuleDebug.cpp: In function ‘wxString get_backtrace(unsigned int)’:
MuleDebug.cpp:405:88: error: ambiguous overload for ‘operator+’ in ‘wxMBConv::cMB2WX(const char*) const(s_file_name) + CFormat(((const wchar_t*)":\000\000\000%\000\000\000u\000\000\000\000\000\000")).CFormat::operator% [with _Tp = unsigned int, CFormat = CFormat](s_line_number)’
/usr/include/wx-2.8/wx/string.h:1421:27: note: candidates are: wxString operator+(const wxString&, const wxString&)
/usr/include/wx-2.8/wx/string.h:1423:27: note:                 wxString operator+(wxChar, const wxString&) <near match>
/usr/include/wx-2.8/wx/string.h:1425:27: note:                 wxString operator+(const wxChar*, const wxString&)
make[4]: *** [MuleDebug.o] Erreur 1
make[3]: *** [all-recursive] Erreur 1
make[2]: *** [all-recursive] Erreur 1
make[1]: *** [all-recursive] Erreur 1
make: *** [all] Erreur 2

No error with "wxWidgets-wxcontainer-devel"
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 07, 2011, 09:27:31 PM
Does it work if you change the offending line to
Code: [Select]
out.Insert(CFormat(wxT("%s:%u")) % wxConvCurrent->cMB2WX(s_file_name) % s_line_number, i*2+1);
?
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 07, 2011, 09:57:41 PM
Sorry for the delay, I don't use many often CPP  ;D

No error with the line after modification.  It's work for MuleDebug.cpp but errors in :

Quote
ClientCreditsList.cpp:271:3: error: ambiguous overload for ‘operator+’ in ‘wxString(((const wchar_t*)"F\000\000\000a\000\000\000i\000\000\000l\000\000\000e\000\000\000d\000\000\000 \000\000\000t\000\000\000o\000\000\000 \000\000\000c\000\000\000r\000\000\000e\000\000\000a\000\000\000t\000\000\000e\000\000\000 \000\000\000n\000\000\000e\000\000\000w\000\000\000 \000\000\000R\000\000\000S\000\000\000A\000\000\000 \000\000\000k\000\000\000e\000\000\000y\000\000\000p\000\000\000a\000\000\000i\000\000\000r\000\000\000:\000\000\000 \000\000\000\000\000\000")) + char2unicode(const char*)()’


ClientCreditsList.cpp:322:3: error: ambiguous overload for ‘operator+’ in ‘wxString(((const wchar_t*)"E\000\000\000r\000\000\000r\000\000\000o\000\000\000r\000\000\000 \000\000\000w\000\000\000h\000\000\000i\000\000\000l\000\000\000e\000\000\000 \000\000\000i\000\000\000n\000\000\000i\000\000\000t\000\000\000i\000\000\000a\000\000\000l\000\000\000i\000\000\000z\000\000\000i\000\000\000n\000\000\000g\000\000\000 \000\000\000e\000\000\000n\000\000\000c\000\000\000r\000\000\000y\000\000\000p\000\000\000t\000\000\000i\000\000\000o\000\000\000n\000\000\000 \000\000\000k\000\000\000e\000\000\000y\000\000\000s\000\000\000:\000\000\000 \000\000\000\000\000\000")) + char2unicode(const char*)()’

ClientCreditsList.cpp:368:3: error: ambiguous overload for ‘operator+’ in ‘wxString(((const wchar_t*)"E\000\000\000r\000\000\000r\000\000\000o\000\000\000r\000\000\000 \000\000\000w\000\000\000h\000\000\000i\000\000\000l\000\000\000e\000\000\000 \000\000\000c\000\000\000r\000\000\000e\000\000\000a\000\000\000t\000\000\000i\000\000\000n\000\000\000g\000\000\000 \000\000\000s\000\000\000i\000\000\000g\000\000\000n\000\000\000a\000\000\000t\000\000\000u\000\000\000r\000\000\000e\000\000\000:\000\000\000 \000\000\000\000\000\000")) + char2unicode(const char*)()’
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 07, 2011, 10:10:42 PM
oups....

Same thing :

Quote
ClientCreditsList.cpp:429:3: error: ambiguous overload for ‘operator+’ in ‘wxString(((const wchar_t*)"E\000\000\000r\000\000\000r\000\000\000o\000\000\000r\000\000\000 \000\000\000w\000\000\000h\000\000\000i\000\000\000l\000\000\000e\000\000\000 \000\000\000v\000\000\000e\000\000\000r\000\000\000i\000\000\000f\000\000\000y\000\000\000i\000\000\000n\000\000\000g\000\000\000 \000\000\000i\000\000\000d\000\000\000e\000\000\000n\000\000\000t\000\000\000i\000\000\000t\000\000\000y\000\000\000:\000\000\000 \000\000\000\000\000\000")) + char2unicode(const char*)()’
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 07, 2011, 11:33:50 PM
Just wrap a wxString() around the char2unicode(), like
Code: [Select]
AddDebugLogLineC(logCredits,
wxString(wxT("Failed to create new RSA keypair: ")) +
wxString(char2unicode(e.what())));
I've attached the patched file for you.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 07, 2011, 11:44:01 PM
Thank you for the file.

Good for this, now :

Quote
Logger.cpp:180:62: error: ambiguous overload for ‘operator+’ in ‘operator+(const wxString&, const wxChar*)(((const wchar_t*)":\000\000\000 \000\000\000\000\000\000")) + char2unicode(const char*)()’

Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 07, 2011, 11:50:06 PM
Code: [Select]
AddLogLine(file, line, critical, logStandard,
cat.GetName() + wxT(": ") + wxString(char2unicode(msg.str().c_str())));
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 07, 2011, 11:55:49 PM
Problem during link :

Code: [Select]
Linking amule
amule-ChatSelector.o:(.rodata._ZTV12CChatSession[vtable for CChatSession]+0x38c): undefined reference to `non-virtual thunk to wxTextCtrlBase::overflow(int)'
libs/common/libmulecommon.a(MuleDebug.o): In function `get_backtrace(unsigned int)':
/home/jl/Download/aMule/aMule-2.3.1rc1/src/libs/common/MuleDebug.cpp:406: undefined reference to `CFormat& CFormat::operator%<wxWCharBuffer>(wxWCharBuffer)'
./libmuleappgui.a(libmuleappgui_a-MuleTextCtrl.o):(.rodata._ZTV13CMuleTextCtrl[vtable for CMuleTextCtrl]+0x38c): undefined reference to `non-virtual thunk to wxTextCtrlBase::overflow(int)'
collect2: ld returned 1 exit status
make[3]: *** [amule] Erreur 1
make[2]: *** [all-recursive] Erreur 1
make[1]: *** [all-recursive] Erreur 1
make: *** [all] Erreur 2
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 08, 2011, 12:10:02 AM
Error 1 ("non-virtual thunk"): use current SVN (http://code.google.com/p/amule/source/checkout) instead of the rc

Error 2: my patch for MuleDebug.cpp:406 was bad, try
Code: [Select]
out.Insert(CFormat(wxT("%s:%u")) % wxString(wxConvCurrent->cMB2WX(s_file_name)) % s_line_number, i*2+1);
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 08, 2011, 12:11:09 AM
With the SVN version you have to run autogen.sh and then configure.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 08, 2011, 12:16:34 AM
SVN 10561 has the OpenSuse fixes. Unless there are more problems.  ;)
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 08, 2011, 12:21:55 AM
OK for the new patch on MuleDebug, it works.

I used autogen and configure when changing from "wxWidgets" to "wxWidgets-wxcontainer" and back.

For the SVN instead of the RC I'll do that tomorrow, it is midnight here and my day was a little hard.  :)

I'll write the result of tests after this operation.


Thank you for the "debug" online.

Quote
SVN 10561 has the OpenSuse fixes. Unless there are more problems. 

What problem ????? Only solutions.  ;)
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 08, 2011, 01:09:54 PM
Either I am cursed, or I am stupid. I do not find the mentioned SVN (10561). I found only 10533.....

Could you give me the URL of the "running" SVN ?

Thank you.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 08, 2011, 09:01:00 PM
svn checkout http://amule.googlecode.com/svn/trunk/
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 08, 2011, 09:25:48 PM
Definitively I'm cursed. (As all the "normal" users of openSuse 11.4)  :)

Geting the SVN : OK
autogen.sh : OK
configure :

checking for wxWidgets version >= 2.8.12 (--unicode=yes)... no (version 2.8.11 is not new enough)
configure: error:
    The requested wxWidgets build couldn't be found.

2.8.11 is the last version distributed by SUSE.

I have changed in the configure script to accept 2.8.11 to see if compilation and link work. But.... maybe it will be bugs during execution.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 08, 2011, 09:43:36 PM
Compil and Link : OK
Execution :

 2011-05-08 21:38:07: amuleAppCommon.cpp(331): Initialising aMule SVN compiled with wxGTK2 v2.8.11 (Debugging) (Snapshot: rev. 10562)
 2011-05-08 21:38:07: amuleAppCommon.cpp(377): Checking if there is an instance already running...
 2011-05-08 21:38:07: amuleAppCommon.cpp(408): No other instances are running.
 2011-05-08 21:38:08: ListenSocket.cpp(65): ListenSocket : Ok.
        aMule Version: aMule SVN compiled with wxGTK2 v2.8.11 (Debugging) (Snapshot: rev. 10562)

Terminated after throwing an instance of 'std::out_of_range'
        what(): basic_string::at
        backtrace:
[2] CamuleApp::OnUnhandledException() in amule.cpp:1950
[3] wxEntry(int&, wchar_t**) in /usr/lib/wx-2.8-stl/libwx_baseu-2.8.so.0[0xb6db0557]
[4] wxEntry(int&, char**) in /usr/lib/wx-2.8-stl/libwx_baseu-2.8.so.0[0xb6db05c6]
[5] main in amule-gui.cpp:93
[6] __libc_start_main in /lib/libc.so.6[0xb6a84c2e]
[7] _start in start.S:122


So, openSuse users have to wait next version (2.8.12) of wxWidgets before using last version of aMule.

No matter, we'll wait. :)
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 08, 2011, 10:25:58 PM
2.8.12 is required because of a networking problem fixed there. It's not related to what you are seeing here. Hm.

I should say wx build is somehow screwed in Suse. Can you try to build wx yourself ? Don't install it, just configure aMule then using --with-wxdir (like described in the wiki for Ubuntu (http://wiki.amule.org/index.php/HowTo_Compile_In_Ubuntu)).
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 08, 2011, 11:13:53 PM
I can try to do that but I need more time because there is a long time I didn't do that. I was developer but 15 years ago and I'm a little "rusty" now.

Anyway thank you for your speed to debug all the configurations.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 09, 2011, 10:36:40 AM
I did as you said.......

Don't ask me why but it's work :)

Now I have only to solve a problem with Kad

Code: [Select]
2011-05-09 10:30:28: RoutingZone.cpp(307): Only 0 Kad contacts available, nodes.dat not written
2011-05-09 10:30:28: RoutingZone.cpp(172): Failed to read nodes.dat file - too old. This version (0) is not supported anymore.

but this is not a "Compilation problem" so I'll check  other threads.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Stu Redman on May 09, 2011, 10:02:32 PM
I did as you said.......
You mean, compiled wx yourself?
Title: Re: Building aMule on openSUSE >= 11.4
Post by: macias on May 09, 2011, 10:07:48 PM
Just for the record, and other openSUSE users, I compiled wx myself and new aMule also (RC1), no problems at all. I am back with 2.2.6 though, I like UI better.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Zoltic on May 09, 2011, 10:17:44 PM
Absolutly, compiling wxWidgets 2.8.12 as described in the wiki for Ubuntu.

Compiling aMule SVN 10562 with --with-wxdir to the compiled wxWidgets 2.8.12
Title: Re: Building aMule on openSUSE >= 11.4
Post by: macias on June 05, 2011, 02:35:13 PM
Just for the record (after testing several combos) the best match  for openSUSE 11.4 is installing wx (container version) from repos, unaltered, and then building aMule 2.2.6 by yourself (no patches, or anything). Compilation is w/o problems and it works as it should -- no problems either.
Title: Re: Building aMule on openSUSE >= 11.4
Post by: Gerd78 on June 11, 2011, 02:29:15 PM
I should say wx build is somehow screwed in Suse.
It's not really screwed, it's just a little tricky to use because of the two incompatible binary interfaces (stl + wxcontainer).
Title: Re: Building aMule on openSUSE >= 11.4
Post by: macias on June 11, 2011, 04:43:31 PM
I forgot, there is 2.8.12 for openSUSE but in branched repository. http://download.opensuse.org/repositories/X11:/wxWidgets/ I switched to it, and results are even better (with compiled myself AMule 2.2.6).