From: Hiromichi Watari Date: April 2 2011 9:57pm Subject: Problem linking STL::map with mysqld List-Archive: http://lists.mysql.com/internals/38280 Message-Id: <753258.73288.qm@web121505.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi, I'm trying to use STL container "map" with MySQL server but I'm getting the following link error at the very end. CXXFLAGS="-DUSE_SYS_STL" table.h has the following #include . . . std::map foo; Are there any name conflicts, since table.h is eventually included in just about every source ? I'm not sure if I can use namespace to work around this problem ? Thanks, Hiromichi ----------------------------------------------------------------------------------------------------------------------------------------------------------- . . . . . [100%] Building CXX object sql/CMakeFiles/sql.dir/sql_yacc.cc.o [100%] Building CXX object sql/CMakeFiles/sql.dir/sql_builtin.cc.o Linking CXX static library libsql.a [100%] Built target sql [100%] Building CXX object sql/CMakeFiles/mysqld.dir/main.cc.o Linking CXX executable mysqld libsql.a(sql_base.cc.o): In function `std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::~_Rb_tree()': sql_base.cc:(.text._ZNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EED2Ev[_ZNSt8_Rb_treeIiSt4pairIKiiESt10_Select1stIS2_ESt4lessIiESaIS2_EED5Ev]+0x28): undefined reference to `std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_erase(std::_Rb_tree_node >*)' libsql.a(sql_insert.cc.o): In function `std::map, std::allocator > >::operator=(std::map, std::allocator > > const&)': sql_insert.cc:(.text._ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEaSERKS6_[std::map, std::allocator > >::operator=(std::map, std::allocator > > const&)]+0x20): undefined reference to `std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::operator=(std::_Rb_tree, std::_Select1st >, std::less, std::allocator > > const&)' collect2: ld returned 1 exit status make[2]: *** [sql/mysqld] Error 1 make[1]: *** [sql/CMakeFiles/mysqld.dir/all] Error 2 make: *** [all] Error 2