Hi Ali, Your problem is as it states
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status The linker, ld, does not know where to find the library libmysqlclient.so. You need to tell the linker using either ldconfig (man ldconfig) or LD_LIBRARY_PATH variable. Regards --------------------------------------------------------------- ********** _/ ********** David Logan ******* _/ ******* ITO Delivery Specialist - Database ***** _/ ***** Hewlett-Packard Australia Ltd **** _/_/_/ _/_/_/ **** E-Mail: [EMAIL PROTECTED] **** _/ _/ _/ _/ **** Desk: +618 8408 4273 **** _/ _/ _/_/_/ **** Mobile: 0417 268 665 ***** _/ ****** ****** _/ ******** Postal: 148 Frome Street, ******** _/ ********** Adelaide SA 5001 Australia i n v e n t --------------------------------------------------------------- -----Original Message----- From: ali asghar torabi parizy [mailto:[EMAIL PROTECTED] Sent: Monday, 24 July 2006 6:54 PM To: mysql@lists.mysql.com Subject: undefined reference to `mysqlpp::Connection::Connection(bool)' Hi, I am begeener to MySQL. I have installed Suse10 and MySQL and mysql++ in my pc. i want to connect to MySQL through C. When I am compiling the program, I am getting the following error. ######################################## #gcc -o custom1 -lmysqlclient -lz custom1.cpp /usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status a-toraby:~/c/example # gcc -o custom1 -lmysqlclient -L /usr/local/mysql/lib/mysql/ custom1.cpp /tmp/ccPQEF5p.o: In function `main': custom1.cpp:(.text+0x2f): undefined reference to `mysqlpp::Connection::Connection(bool)' custom1.cpp:(.text+0x46): undefined reference to `connect_to_db(int, char**, mysqlpp::Connection&, char const*)' custom1.cpp:(.text+0x7f): undefined reference to `mysqlpp::Connection::query()' custom1.cpp:(.text+0x96): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'... ... ... ... ... ...std::allocator<stock> > >(std::vector<stock, std::allocator<stock> >&, mysqlpp::SQLQueryParms&, mysqlpp::query_reset)]+0x50): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const' custom1.cpp:(.gnu.linkonce.t._ZN7mysqlpp5Query7storeinISt6vectorI5stockSaIS3_EEEEvRT_RNS_13SQLQueryParmsENS_11query_resetE[void mysqlpp::Query::storein<std::vector<stock, std::allocator<stock> > >(std::vector<stock, std::allocator<stock> >&, mysqlpp::SQLQueryParms&, mysqlpp::query_reset)]+0x71): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' custom1.cpp:(.gnu.linkonce.t._ZN7mysqlpp5Query7storeinISt6vectorI5stockSaIS3_EEEEvRT_RNS_13SQLQueryParmsENS_11query_resetE[void mysqlpp::Query::storein<std::vector<stock, std::allocator<stock> > >(std::vector<stock, std::allocator<stock> >&, mysqlpp::SQLQueryParms&, mysqlpp::query_reset)]+0x88): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /tmp/ccPQEF5p.o:(.gnu.linkonce.r._ZTIN7mysqlpp8BadQueryE[typeinfo for mysqlpp::BadQuery]+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info' /tmp/ccPQEF5p.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0' collect2: ld returned 1 exit status ################################################### my code is standard code in mysql++ examples directory please help me. --------------------------------- Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1ยข/min. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]