News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Difficulty running Code::Blocks due to Standard C++ library mismatches

Started by Chocoboko, August 25, 2006, 04:33:24 AM

Previous topic - Next topic

Chocoboko

Hi all,

I'm running Slackware Linux 10.2.  I am having difficulty getting Code::Blocks to run.  First, I downloaded one of those precompiled binaries (the RPM one) and got an error for saying my C++ standard library shared objects didn't match the ones Code::Blocks used.  So perhaps since I wasn't using an RPM-based Linux, that might've been the issue.  So I tried compiling Code::Blocks myself from the source from the SVN.  Lo and behold, I can't compile it for the same reason--errors in compatibility with the version of the C++ standard library used:

Quote
../../../../src/plugins/codecompletion/nativeparser.cpp: In member function 'size_t NativeParser::FindAIMatches(Parser*, std::queue<ParserComponent, std::deque<ParserComponent, std::allocator<ParserComponent> > >, TokenIdxSet&, int, bool, bool, bool, short int, TokenIdxSet*)':
../../../../src/plugins/codecompletion/nativeparser.cpp:1379: error: no match for 'operator==' in 'itsearch == 0'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:285: note: candidates are: bool std::_Rb_tree_const_iterator<_Tp>::operator==(const std::_Rb_tree_const_iterator<_Tp>&) const [with _Tp = int]
/usr/local/include/wx-2.6/wx/string.h:1436: note:                 bool operator==(const wxString&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1438: note:                 bool operator==(const wxString&, const wxChar*)
/usr/local/include/wx-2.6/wx/string.h:1440: note:                 bool operator==(const wxChar*, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1474: note:                 bool operator==(const wxString&, const wxWCharBuffer&)
/usr/local/include/wx-2.6/wx/string.h:1476: note:                 bool operator==(const wxWCharBuffer&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1509: note:                 bool operator==(wxChar, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1510: note:                 bool operator==(const wxString&, wxChar)
/usr/local/include/wx-2.6/wx/longlong.h:916: note:                 bool operator==(long int, const wxLongLong&)
/usr/local/include/wx-2.6/wx/longlong.h:929: note:                 bool operator==(long unsigned int, const wxULongLong&)
/usr/local/include/wx-2.6/wx/treebase.h:84: note:                 bool operator==(const wxTreeItemId&, const wxTreeItemId&)
../../../src/sdk/tinyxml/tinystr.h:254: note:                 bool operator==(const TiXmlString&, const TiXmlString&)
../../../src/sdk/tinyxml/tinystr.h:269: note:                 bool operator==(const TiXmlString&, const char*)
../../../src/sdk/tinyxml/tinystr.h:270: note:                 bool operator==(const char*, const TiXmlString&)
../../../../src/plugins/codecompletion/nativeparser.cpp:1381: error: no match for 'operator!=' in 'itsearch != 0'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:289: note: candidates are: bool std::_Rb_tree_const_iterator<_Tp>::operator!=(const std::_Rb_tree_const_iterator<_Tp>&) const [with _Tp = int]
/usr/local/include/wx-2.6/wx/string.h:1442: note:                 bool operator!=(const wxString&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1444: note:                 bool operator!=(const wxString&, const wxChar*)
/usr/local/include/wx-2.6/wx/string.h:1446: note:                 bool operator!=(const wxChar*, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1478: note:                 bool operator!=(const wxString&, const wxWCharBuffer&)
/usr/local/include/wx-2.6/wx/string.h:1480: note:                 bool operator!=(const wxWCharBuffer&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1511: note:                 bool operator!=(wxChar, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1512: note:                 bool operator!=(const wxString&, wxChar)
/usr/local/include/wx-2.6/wx/longlong.h:917: note:                 bool operator!=(long int, const wxLongLong&)
/usr/local/include/wx-2.6/wx/longlong.h:930: note:                 bool operator!=(long unsigned int, const wxULongLong&)
/usr/local/include/wx-2.6/wx/treebase.h:89: note:                 bool operator!=(const wxTreeItemId&, const wxTreeItemId&)
../../../src/sdk/tinyxml/tinystr.h:264: note:                 bool operator!=(const TiXmlString&, const TiXmlString&)
../../../src/sdk/tinyxml/tinystr.h:271: note:                 bool operator!=(const TiXmlString&, const char*)
../../../src/sdk/tinyxml/tinystr.h:272: note:                 bool operator!=(const char*, const TiXmlString&)
../../../../src/plugins/codecompletion/nativeparser.cpp:1394: error: no match for 'operator==' in 'itsearch == 0'
/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:285: note: candidates are: bool std::_Rb_tree_const_iterator<_Tp>::operator==(const std::_Rb_tree_const_iterator<_Tp>&) const [with _Tp = int]
/usr/local/include/wx-2.6/wx/string.h:1436: note:                 bool operator==(const wxString&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1438: note:                 bool operator==(const wxString&, const wxChar*)
/usr/local/include/wx-2.6/wx/string.h:1440: note:                 bool operator==(const wxChar*, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1474: note:                 bool operator==(const wxString&, const wxWCharBuffer&)
/usr/local/include/wx-2.6/wx/string.h:1476: note:                 bool operator==(const wxWCharBuffer&, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1509: note:                 bool operator==(wxChar, const wxString&)
/usr/local/include/wx-2.6/wx/string.h:1510: note:                 bool operator==(const wxString&, wxChar)
/usr/local/include/wx-2.6/wx/longlong.h:916: note:                 bool operator==(long int, const wxLongLong&)
/usr/local/include/wx-2.6/wx/longlong.h:929: note:                 bool operator==(long unsigned int, const wxULongLong&)
/usr/local/include/wx-2.6/wx/treebase.h:84: note:                 bool operator==(const wxTreeItemId&, const wxTreeItemId&)
../../../src/sdk/tinyxml/tinystr.h:254: note:                 bool operator==(const TiXmlString&, const TiXmlString&)
../../../src/sdk/tinyxml/tinystr.h:269: note:                 bool operator==(const TiXmlString&, const char*)
../../../src/sdk/tinyxml/tinystr.h:270: note:                 bool operator==(const char*, const TiXmlString&)
make[4]: *** [nativeparser.lo] Error 1

Is there a specific version of GCC I need installed?  Or is there any place I can find the needed libraries for Code::Blocks?  Anything else you'd recommend that I do.

Thank you very much for your time in reading this.

mandrav

This error happens with some gcc versions, can't tell which exactly though.
Anyway search the forum (from the boards index, *not* from here) for this error. I think I saw a patch about it yesterday but I was in a hurry...
Be patient!
This bug will be fixed soon...

heromyth

It seems the patch works. However, I'm wondering what's the reason with using the code 'itsearch == 0'. I think many compiler can't support it. Maybe it's thinking of the search_scope could be NULL. If it is not that, I think my modification is still working:

Index: nativeparser.cpp

===================================================================

--- nativeparser.cpp (revision 2898)

+++ nativeparser.cpp (working copy)

@@ -1396,11 +1396,10 @@

#endif
             // search under all search-scope namespaces too
             TokenIdxSet::iterator itsearch;
-            if (search_scope)
-                itsearch = search_scope->begin();
-            while (itsearch == 0 || itsearch != search_scope->end())
+            itsearch = search_scope->begin();
+            while (itsearch != search_scope->end())
             {
-                Token* parent = tree->at(itsearch != 0 ? *itsearch : parentTokenIdx);
+                Token* parent = tree->at(*itsearch);
#ifdef DEBUG_CC_AI
                 Manager::Get()->GetMessageManager()->DebugLog(_T(" : looking under '%s'"), parent ? parent->m_Name.c_str() : _T("Global namespace"));
#endif
@@ -1413,8 +1412,6 @@

                         break;
                     parent = tree->at(parent->m_ParentIndex);
                 } while (true);
-                if (itsearch == 0)
-                    break;
                 ++itsearch;
             }
             // we got all possible types (hopefully should be just one)

mandrav

Quote from: heromyth on August 25, 2006, 06:30:24 PM
It seems the patch works. However, I'm wondering what's the reason with using the code 'itsearch == 0'. I think many compiler can't support it. Maybe it's thinking of the search_scope could be NULL.

Did you see it applied? No. ;)
I plan to fix it "correctly"...
Be patient!
This bug will be fixed soon...

Game_Ender

Slightly off topic, but I didn't know you could check to see if iterators equaled NULL or 0.  Is that even standards compliant?  The standard iterators are objects with the semantics partially (or fully) matching a pointer.  I just checked and none of the standard iterators support comparison to NULL or 0, at least officially.  Of course this could all be moot if that's a custom iterator and not just a typedef of a standard one.