8 messages in com.mysql.lists.pluspluscompiling mysql++ examples (fwd)
FromSent OnAttachments
Enrique Farfan05 Oct 2004 09:51 
Warren Young05 Oct 2004 13:08 
Don Thompson08 Oct 2004 10:22.txt
Warren Young08 Oct 2004 10:59 
Don Thompson08 Oct 2004 11:40 
Warren Young08 Oct 2004 12:59 
Don Thompson08 Oct 2004 18:22 
Chris Frey09 Oct 2004 11:07 
Subject:compiling mysql++ examples (fwd)
From:Enrique Farfan (efar@istec.org)
Date:10/05/2004 09:51:03 AM
List:com.mysql.lists.plusplus

Hi, thanks for your time helping me out....

first I have a ReadHat 9 in my system. I have the following rpm installed in my comp.: $rpm -qa | grep -i mysql

mysql-3.23.58-1.9 MySQL-client-4.1.5-0 MySQL-devel-4.1.5-0 perl-DBD-MySQL-2.1021-3 MySQL-server-4.1.5-0 mysql++-1.7.17-1

I tryed to compiled the example, which comes in the tar file mysql++-1.7.17.tar, called simple1.cc. For that I use the following command: #g++ -I /usr/include/sqlplusint -I /usr/include/mysql -I /usr/local/mysql++-1.7.17/sqlplusint -L /usr/local/mysql++-1.7.17/sqlplusint -Wno-deprecated -lsqlplus simple1.cc

and the error message is :

/usr/bin/ld: cannot find -lsqlplus collect2: ld returned 1 exit status

so I installed the "sqlplus" in my system [sqlplus-1.7.9-1.i386.rpm]

# rpm -qa | grep -i sqlplus sqlplus-1.7.9-1

I tryed to compile again using the same command: g++ -I /usr/include/sqlplusint -I /usr/include/mysql -I /usr/local/mysql++-1.7.17/sqlplusint -L /usr/local/mysql++-1.7.17/sqlplusint -Wno-deprecated -lsqlplus simple1.cc

and the message are :

/usr/bin/ld: warning: libstlport_gcc.so, needed by /usr/local/lib/libsqlplus.so, not found (try using -rpath or -rpath-link) /tmp/cc5e4dFc.o(.text+0x56d): In function `main': : undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, mysql_ColData<const_string> const&)' /tmp/cc5e4dFc.o(.gnu.linkonce.t._ZN15MysqlConnection5storeERKSs+0x19): In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': : undefined reference to `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::_Rb_global<bool>::_M_increment(_STL::_Rb_tree_node_base*)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::basic_streambuf<char, _STL::char_traits<char> >::_M_snextc_aux()' /usr/local/lib/libsqlplus.so: undefined reference to `non-virtual thunk [nv:-12] to _STL::strstream::~strstream [in-charge deleting]()' /usr/local/lib/libsqlplus.so: undefined reference to `virtual thunk [v:0,-12] to _STL::strstream::~strstream [in-charge deleting]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::cerr' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::_M_throw_failure()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::__node_alloc<(bool)1, (int)0>::_M_deallocate(void*, unsigned)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::strstream::~strstream [not-in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ostrstream::ostrstream[in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::Init::~Init [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::strstream::~strstream [in-charge deleting]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ostrstream::str()' /usr/local/lib/libsqlplus.so: undefined reference to `typeinfo for _STL::ios_base' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::strstream::strstream[not-in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::_Loc_init::_Loc_init[in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::ios_base[not-in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::strstream::pcount() const' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::strstream::~strstream [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::__stl_throw_length_error(char const*)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::__stl_throw_out_of_range(char const*)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ostrstream::~ostrstream [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::~ios_base [not-in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::locale::~locale [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ostrstream::freeze(bool)' /usr/local/lib/libsqlplus.so: undefined reference to `virtual thunk [v:0,-12] to _STL::strstream::~strstream [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::cout' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::Init::Init[in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::locale::locale[in-charge](_STL::locale const&)' /usr/local/lib/libsqlplus.so: undefined reference to `typeinfo for _STL::strstream' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::locale::_M_use_facet(_STL::locale::id const&) const' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::ios_base::_Loc_init::~_Loc_init [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::__node_alloc<(bool)1, (int)0>::_M_allocate(unsigned)' /usr/local/lib/libsqlplus.so: undefined reference to `non-virtual thunk [nv:-12] to _STL::strstream::~strstream [in-charge]()' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::_Rb_global<bool>::_M_decrement(_STL::_Rb_tree_node_base*)' /usr/local/lib/libsqlplus.so: undefined reference to `_STL::_Rb_global<bool>::_Rebalance(_STL::_Rb_tree_node_base*, _STL::_Rb_tree_node_base*&)' collect2: ld returned 1 exit status

------end---------

??????