Just for your information...
I include the stl stuff only in the relevant source file and not in
the public header files... I also followed the hint from Mark -
#include <map> in sql_parse.cc before mysql_priv.h...(at first place)
Again some code snippets:
[in dejavu_router.cc]
#include "dejavu_router.h"
#include <string.h>
#include <map>
using namespace std;
Dejavu_Router::Dejavu_Router(){
map<int,int> temp_map;
int key = 1;
int val = 12345;
temp_map[key]=val;
//_map = (void*) temp_map;
}
This gave me the following errors:
dejavu_router.o: In function `~_Rb_tree':
/usr/include/c++/4.3/bits/stl_tree.h:585: undefined reference to
`std::_Rb_tree<int, std::pair<int const, int>,
std::_Select1st<std::pair<int const, int> >, std::less<int>,
std::allocator<std::pair<int const, int> >
>::_M_erase(std::_Rb_tree_node<std::pair<int const, int> >*)'
dejavu_router.o: In function `std::map<int, int, std::less<int>,
std::allocator<std::pair<int const, int> >
>::insert(std::_Rb_tree_iterator<std::pair<int const, int> >,
std::pair<int const, int> const&)':
/usr/include/c++/4.3/bits/stl_map.h:496: undefined reference to
`std::_Rb_tree<int, std::pair<int const, int>,
std::_Select1st<std::pair<int const, int> >, std::less<int>,
std::allocator<std::pair<int const, int> >
>::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<int const,
int> >, std::pair<int const, int> const&)'
dejavu_router.o: In function `std::_Rb_tree<int, std::pair<int const,
int>, std::_Select1st<std::pair<int const, int> >, std::less<int>,
std::allocator<std::pair<int const, int> > >::lower_bound(int
const&)':
/usr/include/c++/4.3/bits/stl_tree.h:716: undefined reference to
`std::_Rb_tree<int, std::pair<int const, int>,
std::_Select1st<std::pair<int const, int> >, std::less<int>,
std::allocator<std::pair<int const, int> >
>::_M_lower_bound(std::_Rb_tree_node<std::pair<int const, int> >*,
std::_Rb_tree_node<std::pair<int const, int> >*, int const&)'
collect2: ld returned 1 exit status
Thanks anyway!
Patrick
On Fri, Jan 30, 2009 at 7:54 AM, Kesava Poyyale <Kesava.Poyyale@stripped> wrote:
> Hi ,
>
> My two cents for the above topic .
>
> 1)Eventhough there are lot of standalone functions or stl available in the
> language . If possible we can write our own for the same in the MYSQL
> repository for the repeated usage . or maximize the STL usage in the MYSQL
> repository . Please check all the compiler extensions which we are
> supporting in Mysql before putback .
> 2)Since everybody knows what is happening on loading and linking time of
> executable , or may leads to increase the size of exec gradually for the
> further inclusion of the header files and its associated files, which might
> not be using in the high frequency .
> 3)If time permits we can benchmark against various parameters which will
> leads to better performance [code wise ] in the long run .
>
> Thanks & Regards
> Kesava Baby Poyyale
>
>
>
>
> On 01/30/09 00:38, Brian Aker wrote:
>>
>> Hi!
>>
>> On Jan 29, 2009, at 11:06 AM, Eric Prud'hommeaux wrote:
>>
>>> yeah, i'm a big fan of using stl and boost whenever possible.
>>
>> We don't have a benchmark on exceptions yet, but for Drizzle we have found
>> that the STL is as fast, and sometimes faster, then the built in code that
>> MySQL has.
>>
>> If exceptions turn out to not cost us, we will switch to using them as
>> well. We just have not had the time to benchmark them yet.
>>
>> Cheers,
>> -Brian
>>
>>
>> --
>> _______________________________________________________
>> Brian "Krow" Aker, brian at tangent.org
>> Seattle, Washington
>> http://krow.net/ <-- Me
>> http://tangent.org/ <-- Software
>> _______________________________________________________
>> You can't grep a dead tree.
>>
>>
>>
>>
>
>
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe: http://lists.mysql.com/internals?unsub=1
>
>
| Thread |
|---|
| • STL, C++, Mysql Development? | Patrick Lau | 29 Jan |
| • Re: STL, C++, Mysql Development? | MARK CALLAGHAN | 29 Jan |
| • Re: STL, C++, Mysql Development? | Chad MILLER | 29 Jan |
| • Re: Re: STL, C++, Mysql Development? | Eric Prud'hommeaux | 29 Jan |
| • Re: STL, C++, Mysql Development? | Brian Aker | 29 Jan |
| • Re: STL, C++, Mysql Development? | Kesava Poyyale | 30 Jan |
| • Re: STL, C++, Mysql Development? | Patrick Lau | 30 Jan |
| • Re: STL, C++, Mysql Development? | Vladimir Shebordaev | 31 Jan |