aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)  (Read 6921 times)

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105

Hello,

I had this error during the compilation :
erreur: ambiguous overload for « operator+ »
wxGTK/include/wx-2.8/wx/string.h:1421: candidats are wxString operator+(const wxString&, const wxString&)
wxGTK/include/wx-2.8/wx/string.h:1422:                 wxString operator+(const wxString&, wxChar)
wxGTK/include/wx-2.8/wx/string.h:1423:                 wxString operator+(wxChar, const wxString&)
wxGTK/include/wx-2.8/wx/string.h:1424:                 wxString operator+(const wxString&, const wxChar*)
wxGTK/include/wx-2.8/wx/string.h:1425:                 wxString operator+(const wxChar*, const wxString&)


I had to cast with (wxString) in 2 files :
MuleDebug.cpp: line 378
 out.Insert(((const wxString) wxConvCurrent->cMB2WX(s_file_name)) + ((const wxString) wxString::Format(wxT(":%u"), s_line_number)),i*2+1);
ClientCreditsList.cpp : lines 268, 218, 361, 422
I casted char2unicode : (wxString) char2unicode

Then I can compile and run amule.

For information here are my compilation options :
wxGTK :
./configure --with-gtk=2  --prefix=/usr/local/wxGTK-2.8.4 --enable-timedate --enable-stl --enable-gui --enable-plugins --enable-shared --enable-optimise --enable-protocol --enable-http --enable-ftp --with-opengl --enable-sockets --enable-streams --enable-file --enable-textfile --disable-debug --disable-debug_gdb --disable-mem_tracing --disable-profile --disable-ole --enable-timer --enable-unicode --enable-config --enable-protocols --with-regex --with-sdl --enable-controls --enable-log --enable-compat26 --enable-compat24 --with-libpng --with-libjpeg --with-libtiff --with-libxpm --with-zlib --with-expat
aMule :
./configure --prefix=/usr/local/aMule-2.1.3-wx2.8.4 --disable-debug --disable-systray --with-wx-prefix=/usr/local/wxGTK --enable-optimize

Regards.
Logged

lupe

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #1 on: August 24, 2007, 01:14:15 AM »

Hello ecforum,

I configured wxGTK as you suggested and installed it.

When I tried to configure aMule, it returned the same error as you had.  I tried to patch it as you indicate, but I don't know C, and configure now is returning:
MuleDebug.cpp: In function 'void OnUnhandledException()':
MuleDebug.cpp:73: error: expected unqualified-id before '&' token
MuleDebug.cpp:73: error: ISO C++ forbids declaration of 'type name' with no type
MuleDebug.cpp:73: error: expected `)' before '&' token
MuleDebug.cpp:73: error: expected `{' before '&' token
MuleDebug.cpp:73: error: 'e' was not declared in this scope
MuleDebug.cpp:73: error: expected `;' before ')' token
MuleDebug.cpp:75: error: expected primary-expression before 'catch'
MuleDebug.cpp:75: error: expected `;' before 'catch'
MuleDebug.cpp:77: error: expected primary-expression before 'catch'
MuleDebug.cpp:77: error: expected `;' before 'catch'
MuleDebug.cpp:79: error: expected primary-expression before 'catch'
MuleDebug.cpp:79: error: expected `;' before 'catch'
MuleDebug.cpp: In function 'void InstallMuleExceptionHandler()':
MuleDebug.cpp:92: error: 'set_terminate' is not a member of 'std'
make[4]: *** [libmulecommon_a-MuleDebug.o] Error 1
make[4]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3/src/libs/common'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3/src/libs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3'
make: *** [all] Error 2

What I did was:
file ClientCreditsList.cpp
268         AddDebugLogLineM(true, logCredits, wxString(wxT("Failed to create new RSA keypair: ")) + (:wxString) char2unicode(e.what()));
318         AddDebugLogLineM(true, logCredits, wxString(wxT("Error while initializing encryption keys:     ")) + (wxString) char2unicode(e.what()));
361         AddDebugLogLineM(true, logCredits, wxString(wxT("Error while creating signature: ")) + (wx    String) char2unicode(e.what()));
422         AddDebugLogLineM(true, logCredits, wxString(wxT("Error while verifying identity: ")) + (wx    String) char2unicode(e.what()));

file MuleDebug.cpp:
378 /*out.Insert(wxConvCurrent->cMB2WX(s_file_name) + wxString::Format(wxT(":%u"), s_line_number),i*2+    1);*/  <--  old line
379             out.Insert(((const wxString) wxConvCurrent->cMB2WX(s_file_name)) + ((const wxString) w    xString::Format(wxT(":%u"), s_line_number)),i*2+1);

Would you mind checking what I did wrong, please?

Luis
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #2 on: August 25, 2007, 01:17:38 PM »

Hello,

I don't see any error.
The error that you have is in line 73 :  } catch (const std::exception& e) {
It seems that "std::exception" is unknown...  ??? I don't know if it is a C++ standard type or if it is an STL type...

1- you have to compile the patched version of the source, isn't it ? You can download the patch on amule.org.
2- then you cast as I did.

If you did that, I don't know why it is not working. You can try to compile wxGTK with --disable-stl instead of --enable-stl...  ???

I don't know where is the problem...
I hope you will find it.
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #3 on: August 25, 2007, 05:40:51 PM »

To the amule team :
That is the same code in the svn version (aMule-CVS-20070825) so we will have the same errors...
Don't you have the errors ?  (I have a slackware 11)
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #4 on: August 25, 2007, 05:54:02 PM »

No, we don't.

Try the attached patch. Or wait for tomorrow's tarball.
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #5 on: August 25, 2007, 09:49:38 PM »

Try the attached patch. Or wait for tomorrow's tarball.

The patch concerns the problem of Lupe, isn't it ?
I was speaking about the initial post and the casts that I need to add to compile.
Is it  my gcc (version 3.4.6, maybe too old ?) that causes that errors ?
Logged

lupe

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #6 on: August 26, 2007, 07:24:36 PM »

Hello ecforum and Kry,

First of all, thank you for your help.

My original MuleDebug.cpp has the following lines:
 26 #include <exception>            // Needed for std::exception
 27 #include <cxxabi.h>             // Needed for __cxxabiv1::
 28 #include <csignal>              // Needed for raise()
 29 #include <cstdio>
 30 #include <cwchar>               // Needed for fwprintf
 31
 32 #include "MuleDebug.h"          // Interface declaration
 33 #include "StringFunctions.h"    // Needed for unicode2char

The patch mentioned only adds the line:

  3 --- libs/common/MuleDebug.cpp   (revision 7421)
  4 +++ libs/common/MuleDebug.cpp   (working copy)
  5 @@ -25,6 +25,7 @@
  6
  7  #include <cxxabi.h>                // Needed for __cxxabiv1::
  8  #include <csignal>             // Needed for raise()
  9 +#include <exception>               // Needed for std::exception            <-- this line
 10
 11  #include "MuleDebug.h"         // Interface declaration
 12  #include "StringFunctions.h"   // Needed for unicode2char

that is already there, so it is not needed.  Or am I making a mistake?

I tried again, untared aMule and wxGTK, made the modifications you posted and now I get another error:
MuleGifCtrl.cpp: In destructor 'virtual MuleGifCtrl::~MuleGifCtrl()':
MuleGifCtrl.cpp:54: warning: possible problem detected in invocation of delete operator:
MuleGifCtrl.cpp:54: warning: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: warning: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:54: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
MuleGifCtrl.cpp: In member function 'bool MuleGifCtrl::LoadData(const char*, int)':
MuleGifCtrl.cpp:64: warning: possible problem detected in invocation of delete operator:
MuleGifCtrl.cpp:64: warning: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: warning: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:64: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
MuleGifCtrl.cpp:69: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:70: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:70: error: 'wxGIF_OK' was not declared in this scope
MuleGifCtrl.cpp:71: warning: possible problem detected in invocation of delete operator:
MuleGifCtrl.cpp:71: warning: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: warning: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:71: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
MuleGifCtrl.cpp:76: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:77: error: aggregate 'wxImage frame' has incomplete type and cannot be defined
MuleGifCtrl.cpp:78: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp: In member function 'void MuleGifCtrl::Start()':
MuleGifCtrl.cpp:87: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:89: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp: In member function 'virtual wxSize MuleGifCtrl::GetBestSize()':
MuleGifCtrl.cpp:105: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:105: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp: In member function 'void MuleGifCtrl::OnTimer(wxTimerEvent&)':
MuleGifCtrl.cpp:112: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:113: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:115: error: aggregate 'wxImage frame' has incomplete type and cannot be defined
MuleGifCtrl.cpp:116: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:121: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:122: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp: In member function 'void MuleGifCtrl::OnPaint(wxPaintEvent&)':
MuleGifCtrl.cpp:132: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:133: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:137: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
MuleGifCtrl.cpp:137: error: invalid use of undefined type 'struct wxGIFDecoder'
MuleGifCtrl.h:34: error: forward declaration of 'struct wxGIFDecoder'
make[3]: *** [libmuleappgui_a-MuleGifCtrl.o] Error 1
make[3]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lupe/recolhidos/aMule/aMule-2.1.3'
make: *** [all] Error 2

I also tried the today's cvs version, but with no success.

MuleDebug.cpp: In function 'wxString get_backtrace(unsigned int)':
MuleDebug.cpp:376: error: ambiguous overload for 'operator+' in 'wxMBConv::cMB2WX(const char*) const(s_file_name) + wxString::Format(const wxChar*, ...)(s_line_number)'
/usr/local/wxGTK-2.8.4/include/wx-2.8/wx/string.h:1421: note: candidates are: wxString operator+(const wxString&, const wxString&)
/usr/local/wxGTK-2.8.4/include/wx-2.8/wx/string.h:1422: note:                 wxString operator+(const wxString&, wxChar) <near match>
/usr/local/wxGTK-2.8.4/include/wx-2.8/wx/string.h:1423: note:                 wxString operator+(wxChar, const wxString&) <near match>
/usr/local/wxGTK-2.8.4/include/wx-2.8/wx/string.h:1424: note:                 wxString operator+(const wxString&, const wxChar*)
/usr/local/wxGTK-2.8.4/include/wx-2.8/wx/string.h:1425: note:                 wxString operator+(const wxChar*, const wxString&)
make[4]: *** [libmulecommon_a-MuleDebug.o] Error 1
make[4]: Leaving directory `/home/lupe/recolhidos/amule-cvs/src/libs/common'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/lupe/recolhidos/amule-cvs/src/libs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/lupe/recolhidos/amule-cvs/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/lupe/recolhidos/amule-cvs'
make: *** [all] Error 2

Why is this so difficult to compile?
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #7 on: August 26, 2007, 08:00:24 PM »

Because mine is a patch for aMule CVS, not 2.1.3

Compile the CVS version of tomorrow.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #8 on: August 28, 2007, 02:12:52 AM »

Better, tomorow.
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #9 on: August 29, 2007, 09:13:48 PM »

Concerning the initial post :
The cvs version does not compile with wxGTK compiled with --enable-stl option.
It's ok with --disable-stl.
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #10 on: August 29, 2007, 11:25:32 PM »

aha, then I won't even bother fixing it!
Logged

ecforum

  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 105
Re: [solved] compilation errors (amule 2.1.3+patch with wxGTK-2.8.4)
« Reply #11 on: August 30, 2007, 06:42:44 PM »

That's why I posted ! ;)
But it is maybe something to add in the install notes...
Logged