GGreg . writes:
> Hi,
> 
> I've installed the mysql++ RPM under my Mandrake 7.2 and it works.
> After that, yhen I'm trying to compile a src file :
> 
> 
> #include <sqlplus.hh>
> #include <iostream>
> #include <iomanip>
>  
> int main() {
>  
>    Connection con("MISDIS","localhost","root","DisMis");
>  
>    Query query = con.query();
>  
>    query << "select * from Wizard";
>  
>    Result res = query.store();
>  
>    cout << "Query: " << query.preview() << endl;
>  
>    cout << "Records Found: " << res.size() << endl << endl;
>  
>    return 0;
>  
> }        
> 
> with g++, it tells me :
> 
> /tmp/ccfWoaBO.o: In function `main':
> /tmp/ccfWoaBO.o(.text+0x2e): undefined reference to 
>`MysqlConnection::MysqlConnection(char const *, char const *, char const *, char 
>const *, bool)'
> /tmp/ccfWoaBO.o(.text+0x18c): undefined reference to 
>`MysqlConnection::~MysqlConnection(void)'
> /tmp/ccfWoaBO.o(.text+0x21d): undefined reference to 
>`MysqlConnection::~MysqlConnection(void)'
> /tmp/ccfWoaBO.o(.rodata+0x15c): undefined reference to `mysql_date type_info node'
> /tmp/ccfWoaBO.o(.rodata+0x194): undefined reference to `mysql_time type_info node'
> /tmp/ccfWoaBO.o: In function `MysqlDate type_info function':
> /tmp/ccfWoaBO.o(.gnu.linkonce.t.__tf9MysqlDate+0x18): undefined reference to 
>`mysql_date type_info function'
> /tmp/ccfWoaBO.o: In function `MysqlTime type_info function':
> /tmp/ccfWoaBO.o(.gnu.linkonce.t.__tf9MysqlTime+0x18): undefined reference to 
>`mysql_time type_info function'
> /tmp/ccfWoaBO.o: In function `MysqlRes::~MysqlRes(void)':
> /tmp/ccfWoaBO.o(.gnu.linkonce.t._._8MysqlRes+0x1b): undefined reference to 
>`MysqlResUse::~MysqlResUse(void)'
> /tmp/ccfWoaBO.o: In function `MysqlQuery::preview(void)':
> /tmp/ccfWoaBO.o(.MysqlQuery::gnu.linkonce.t.preview(void)+0x1b): undefined reference 
>to `SQLQuery::str(SQLQueryParms const &) const'
> /tmp/ccfWoaBO.o: In function `MysqlRes::num_rows(void) const':
> /tmp/ccfWoaBO.o(.MysqlRes::gnu.linkonce.t.num_rows(void) const+0x14): undefined 
>reference to `mysql_num_rows'
> /tmp/ccfWoaBO.o: In function `MysqlQuery::store(SQLQueryParms &, query_reset)':
> /tmp/ccfWoaBO.o(.MysqlQuery::gnu.linkonce.t.store(SQLQueryParms &, query_reset) 
>+0x40): undefined reference to `SQLQuery::str(SQLQueryParms const &, query_reset)'
> /tmp/ccfWoaBO.o: In function `MysqlRes::fetch_row(void) const':
> /tmp/ccfWoaBO.o(.MysqlRes::gnu.linkonce.t.fetch_row(void) const+0xd8): undefined 
>reference to `mysql_fetch_row'
> /tmp/ccfWoaBO.o(.MysqlRes::gnu.linkonce.t.fetch_row(void) const+0xec): undefined 
>reference to `mysql_fetch_lengths'
> /tmp/ccfWoaBO.o: In function `MysqlRes::data_seek(unsigned int) const':
> /tmp/ccfWoaBO.o(.MysqlRes::gnu.linkonce.t.data_seek(unsigned int) const+0x1c): 
>undefined reference to `mysql_data_seek'
> /tmp/ccfWoaBO.o: In function `MysqlConnection::store(basic_string<char, 
>string_char_traits<char>, __default_alloc_template<true, 0> > const &)':
> /tmp/ccfWoaBO.o(.MysqlConnection::gnu.linkonce.t.store(basic_string<char, 
>string_char_traits<char>, __default_alloc_template<true, 0> > const &)+0x1d): 
>undefined reference to `MysqlConnection::store(basic_string<char, 
>string_char_traits<char>, __default_alloc_template<true, 0> > const &, bool)'
> /tmp/ccfWoaBO.o: In function `MysqlResUse::num_fields(void) const':
> /tmp/ccfWoaBO.o(.MysqlResUse::gnu.linkonce.t.num_fields(void) const+0x12): undefined 
>reference to `mysql_num_fields'
> /tmp/ccfWoaBO.o: In function `FieldTypes::FieldTypes(MysqlResUse const *)':
> /tmp/ccfWoaBO.o(.FieldTypes::gnu.linkonce.t.(MysqlResUse const *)+0x4d): undefined 
>reference to `FieldTypes::init(MysqlResUse const *)'
> collect2: ld returned 1 exit status 
> 
> 
> Please, help me.......
> 
> Thaks.....
> 
> Quiks
> -- 


Hi!

You have to add -lsqlplus to the linker args. 

Next, libsqllus.so has to be in a directory visibie with your dynamic
linker. 

Easiest way to do it is to add directory containing library to
/etc/ld.so.conf and tu run ldconfig.

If that does not help, add #include <define_short> as the first
include.


Regards,

Sinisa

      ____  __     _____   _____  ___     ==  MySQL AB
     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic
    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:[EMAIL PROTECTED]
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaca, Cyprus
  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____
  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
             /*/             \*\                Developers Team

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to