aMule Forum
English => Compilation problems => Topic started by: ecforum on August 12, 2007, 12:17:20 PM
-
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.
-
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
-
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.
-
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)
-
No, we don't.
Try the attached patch. Or wait for tomorrow's tarball.
-
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 ?
-
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?
-
Because mine is a patch for aMule CVS, not 2.1.3
Compile the CVS version of tomorrow.
-
Better, tomorow.
-
Concerning the initial post :
The cvs version does not compile with wxGTK compiled with --enable-stl option.
It's ok with --disable-stl.
-
aha, then I won't even bother fixing it!
-
That's why I posted ! ;)
But it is maybe something to add in the install notes...