Raised This Month: $51 Target: $400
 12% 

STL String Issues


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
showdax
Senior Member
Join Date: Dec 2004
Old 09-15-2005 , 13:18   STL String Issues
Reply With Quote #1

I'm having issues including <string> in a plugin of mine. When included, I get the following compilation errors:

Code:
In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/string:53,
                 from IDatabase.h:14,
                 from IDatabase.cpp:12:
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.h: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(const std::basic_string<_CharT, _Traits, _Alloc>&) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.h:1862: error: expected unqualified-id before '(' token
In file included from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/string:57,
                 from IDatabase.h:14,
                 from IDatabase.cpp:12:
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `typename std::basic_string<_CharT, _Traits, _Alloc>::size_type std::basic_string<_CharT, _Traits, _Alloc>::rfind(const _CharT*, typename _Alloc::size_type, typename _Alloc::size_type) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:730: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(typename _Alloc::size_type, typename _Alloc::size_type, const std::basic_string<_CharT, _Traits, _Alloc>&) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:867: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(typename _Alloc::size_type, typename _Alloc::size_type, const std::basic_string<_CharT, _Traits, _Alloc>&, typename _Alloc::size_type, typename _Alloc::size_type) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:884: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(const _CharT*) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:900: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(typename _Alloc::size_type, typename _Alloc::size_type, const _CharT*) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:916: error: expected unqualified-id before '(' token
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc: In member function `int std::basic_string<_CharT, _Traits, _Alloc>::compare(typename _Alloc::size_type, typename _Alloc::size_type, const _CharT*, typename _Alloc::size_type) const':
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../include/c++/3.4.3/bits/basic_string.tcc:932: error: expected unqualified-id before '(' token
Obviously I can compile things just fine with <string> outside of sourcemm, but I have no idea what's going on with these errors.
showdax is offline
Send a message via MSN to showdax
BAILOPAN
Join Date: Jan 2004
Old 09-15-2005 , 13:41  
Reply With Quote #2

Show me the order of your includes. It should work fine though because the namespaces are totally separate.
__________________
egg
BAILOPAN is offline
showdax
Senior Member
Join Date: Dec 2004
Old 09-15-2005 , 14:47  
Reply With Quote #3

Well it's in IDatabase.cpp, which is compiled as its own object. The cpp file includes:

Code:
#include "AccessPlugin.h"
#include "IDatabase.h"
The header file includes:

Code:
#include <string>
#include <mysql.h>
#include <utldict.h>
AccessPlugin.h includes:

Code:
#include <ISmmPlugin.h>
#include <sourcehook/sourcehook.h>
#include <igameevents.h>
#include <iplayerinfo.h>
showdax is offline
Send a message via MSN to showdax
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-22-2005 , 05:04  
Reply With Quote #4

Will using string not make the plugin kaput on linux ?
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
showdax
Senior Member
Join Date: Dec 2004
Old 09-22-2005 , 14:54  
Reply With Quote #5

Quote:
Originally Posted by c0ldfyr3
Will using string not make the plugin kaput on linux ?
I'm not really sure what you're asking, but I couldn't figure out a solution so I just resorted to using the C-style string functions in the SDK's strtools.h.
showdax is offline
Send a message via MSN to showdax
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 09-23-2005 , 21:35  
Reply With Quote #6

I meant the relationship between SM and linux servers.
They seem to have some problem when using LibSTD thats all I meant.
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode