I was compiling some c++ program where i have used push_back function. At the end I am getting this error:
/usr/include/c++/4.4/bits/stl_vector.h:741: undefined reference to `std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::**_M_insert_aux**(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
In file stl_vector.h you will find _M_insert_aux but i couldn’t find its definition.
Please suggest to me how to overcome this problem.
Code snippet:
for (table=lex->query_tables; table; table=table->next_global)
{
string table_db=table->db;
table_db += ":";
table_db= table_db+table->table_name;
current.tables.push_back(table_db);
DBUG_PRINT("Dip", (" %s: %s, %s",table->db, table->table_name, table->alias));
}
I reproduced this compiler error with the following (
main.cpp):Compiler command:
It compiles if
-fno-implicit-templatesoption is not specified.Check if the compiler flag
-fno-implicit-templatesis being specified and remove it if possible.To build with
-fno-implicit-templatesI changed the source to:EDIT:
I downloaded mysql 5.1.60 and built it successfully using the
configureandmakecommands you provided in the comment.I then edited the file “sql_parse.cc” as follows:
I then ran
makeagain and it compiled and linked successfully.Note I compiled with
-fno-implicit-templates: I made no other change to the mysql distribution apart from the ones I made to “sql_parse.cc”.