List:Internals« Previous MessageNext Message »
From:Patrick Lau Date:January 29 2009 4:10pm
Subject:STL, C++, Mysql Development?
View as plain text  
Hi all,

Is it possible to use STL for mysql development? I tried to use
std::map, but it fails everytime during compilation...

Here some code snippets:

[dejavu_router.h]

#ifndef ROUTER_H_
#define ROUTER_H_

#include <map>
#include <string>

//using namespace std;

class Dejavu_Router
{
private:
	std::map<std::string, int> freq;
	std::string key;
public:
	Dejavu_Router(){
		int b = 245;
		key = "hallo";
		freq[key]=b;
	}
	int test_get_freq(std::string st);
};

#endif /*ROUTER_H_*/

Compiling error message:

In file included from /usr/include/c++/4.3/bits/stl_tree.h:67,
                 from /usr/include/c++/4.3/map:65,
                 from dejavu_router.h:4,
                 from dejavu_fsm.h:5,
                 from mysql_priv.h:43,
                 from ha_ndbcluster.cc:26:
/usr/include/c++/4.3/bits/stl_algobase.h:232:56: error: macro "min"
passed 3 arguments, but takes just 2
/usr/include/c++/4.3/bits/stl_algobase.h:252:56: error: macro "max"
passed 3 arguments, but takes just 2
...
In file included from /usr/include/c++/4.3/bits/stl_tree.h:67,
                 from /usr/include/c++/4.3/map:65,
                 from dejavu_router.h:4,
                 from dejavu_fsm.h:5,
                 from mysql_priv.h:43,
                 from ha_ndbcluster.cc:26:
/usr/include/c++/4.3/bits/stl_algobase.h:188: error: expected
unqualified-id before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:188: error: expected `)' before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:188: error: expected `)' before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:188: error: expected
initializer before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:210: error: expected
unqualified-id before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:210: error: expected `)' before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:210: error: expected `)' before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:210: error: expected
initializer before 'const'
/usr/include/c++/4.3/bits/stl_algobase.h:232: error: function
definition does not declare parameters
/usr/include/c++/4.3/bits/stl_algobase.h:252: error: function
definition does not declare parameters
/usr/include/c++/4.3/bits/stl_algobase.h: In static member function
'static bool std::__lexicographical_compare<true>::__lc(const _Tp*,
const _Tp*, const _Up*, const _Up*)':
/usr/include/c++/4.3/bits/stl_algobase.h:904: error: expected
unqualified-id before '(' token
....

dejavu_fsm.h does not use any STL stuff. Compilation works without
dejavu_router.h...

I'm using mysql-6.0.3-alpha, gcc 4.3.2, ubuntu 8.10....

Thanks for your help in advance...
Regards,
Patrick
Thread
STL, C++, Mysql Development?Patrick Lau29 Jan
  • Re: STL, C++, Mysql Development?MARK CALLAGHAN29 Jan
  • Re: STL, C++, Mysql Development?Chad MILLER29 Jan
    • Re: Re: STL, C++, Mysql Development?Eric Prud'hommeaux29 Jan
      • Re: STL, C++, Mysql Development?Brian Aker29 Jan
        • Re: STL, C++, Mysql Development?Kesava Poyyale30 Jan
          • Re: STL, C++, Mysql Development?Patrick Lau30 Jan
            • Re: STL, C++, Mysql Development?Vladimir Shebordaev31 Jan