hello.
i want to connect to mysql from c++ .
i examine any version or platform.
i use mysql5 and 4 in suse10 with gcc.then examine mingw and mysql5 and 4
and 3 for severeal times but i can't solve this problem.when i want to compile
examples of mysql++ following error appeared:
**************************************************
custom1.o(.text+0x180):custom1.cpp: undefined reference to
`_imp___ZN7mysqlpp10C
onnectionC1Eb'
custom1.o(.text+0x1ba):custom1.cpp: undefined reference to
`connect_to_db(int, c
har**, mysqlpp::Connection&, char const*)'
custom1.o(.text+0x1d6):custom1.cpp: undefined reference to
`mysqlpp::Connection:
:~Connection()'
custom1.o(.text+0x1fd):custom1.cpp: undefined reference to
`_imp___ZN7mysqlpp10C
onnection5queryEv'
custom1.o(.text+0x2ef):custom1.cpp: undefined reference to
`print_stock_header(i
nt)'
custom1.o(.text+0x3fe):custom1.cpp: undefined reference to
`print_stock_row(std:
:string const&, long long, double, double, mysqlpp::Date const&)'
custom1.o(.text+0x509):custom1.cpp: undefined reference to
`mysqlpp::Connection:
:~Connection()'
custom1.o(.text+0x53b):custom1.cpp: undefined reference to
`mysqlpp::Connection:
:~Connection()'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x39):custom1.cp
p: undefined reference to `vtable for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x48):custom1.cp
p: undefined reference to `vtable for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x57):custom1.cp
p: undefined reference to `vtable for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x63):custom1.cp
p: undefined reference to `vtable for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x21a):custom1.c
pp: undefined reference to `VTT for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x240):custom1.c
pp: undefined reference to `VTT for mysqlpp::Query'
custom1.o(.text$_ZN7mysqlpp5Query7storeinISt6vectorI5stockSaIS3_EEEEvRT_RNS_13SQ
LQueryParmsENS_11query_resetE[void mysqlpp::Query::storein<std::vector<stock,
st
d::allocator<stock> > >(std::vector<stock, std::allocator<stock> >&,
mysqlpp::SQ
LQueryParms&, mysqlpp::query_reset)]+0x71):custom1.cpp: undefined reference
to `
_imp___ZN7mysqlpp5Query3strERNS_13SQLQueryParmsENS_11query_resetE'
custom1.o(.text$_ZN7mysqlpp4DateD1Ev[mysqlpp::Date::~Date()]+0xb):custom1.cpp: u
ndefined reference to `vtable for mysqlpp::Date'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x59):custom
1.cpp: undefined reference to `_imp___ZN7mysqlpp5Query3useEPKc'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x85):custom
1.cpp: undefined reference to [EMAIL PROTECTED]'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0xb3):custom
1.cpp: undefined reference to [EMAIL PROTECTED]'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0xde):custom
1.cpp: undefined reference to `_imp___ZN7mysqlpp3RowC1ERKPPcPKNS_6ResUseEPmb'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x114):custo
m1.cpp: undefined reference to `mysqlpp::Row::~Row()'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x1fd):custo
m1.cpp: undefined reference to `mysqlpp::Row::~Row()'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x223):custo
m1.cpp: undefined reference to `mysqlpp::Row::~Row()'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x249):custo
m1.cpp: undefined reference to `mysqlpp::ResUse::~ResUse()'
custom1.o(.text$_ZN7mysqlpp5Query16storein_sequenceISt6vectorI5stockSaIS3_EEEEvR
T_PKc[void mysqlpp::Query::storein_sequence<std::vector<stock,
std::allocator<st
ock> > >(std::vector<stock, std::allocator<stock> >&, char
const*)]+0x282):custo
m1.cpp: undefined reference to `mysqlpp::ResUse::~ResUse()'
custom1.o(.text$_ZN7mysqlpp4DateC1ERKNS_12ColData_TmplINS_12const_stringEEE[mysq
lpp::Date::Date(mysqlpp::ColData_Tmpl<mysqlpp::const_string>
const&)]+0x45):cust
om1.cpp: undefined reference to `vtable for mysqlpp::Date'
custom1.o(.text$_ZN7mysqlpp4DateC1ERKNS_12ColData_TmplINS_12const_stringEEE[mysq
lpp::Date::Date(mysqlpp::ColData_Tmpl<mysqlpp::const_string>
const&)]+0x7b):cust
om1.cpp: undefined reference to `_imp___ZN7mysqlpp4Date7convertEPKc'
custom1.o(.text$_ZNK7mysqlpp12ColData_TmplINS_12const_stringEE4convIdEET_S4_[dou
ble mysqlpp::ColData_Tmpl<mysqlpp::const_string>::conv<double>(double)
const]+0x
150):custom1.cpp: undefined reference to
`_imp___ZN7mysqlpplsERSoRKNS_12ColData_
TmplINS_12const_stringEEE'
custom1.o(.text$_ZNK7mysqlpp12ColData_TmplINS_12const_stringEE4convIxEET_S4_[lon
g long mysqlpp::ColData_Tmpl<mysqlpp::const_string>::conv<long long>(long
long)
const]+0x153):custom1.cpp: undefined reference to
`_imp___ZN7mysqlpplsERSoRKNS_1
2ColData_TmplINS_12const_stringEEE'
custom1.o(.text$_ZN7mysqlpp4DateC1Ev[mysqlpp::Date::Date()]+0x16):custom1.cpp: u
ndefined reference to `vtable for mysqlpp::Date'
custom1.o(.text$_ZN7mysqlpp4DateC1ERKS0_[mysqlpp::Date::Date(mysqlpp::Date
const
&)]+0x16):custom1.cpp: undefined reference to `vtable for mysqlpp::Date'
collect2: ld returned 1 exit status
********************************************
i use following statements:
//////////
C:\MinGW\bin>g++ custom1.cpp -I c:\mysql++\include -I c:\mysql\include
//////////
C:\MinGW\bin>g++ -c custom1.cpp -I c:\mysql++\include -I c:\mysql\include
C:\MinGW\bin>g++ -o custom custom1.o -I c:\mysql++\include -I c:\mysql\include
/////////// in this topic first line execute correctly but second prompt the
common error.
//////////
C:\MinGW\bin>g++ -c custom1.cpp -I c:\mysql++\include -I c:\mysql\include
C:\MinGW\bin>g++ -o custom custom1.o -I c:\mysql++\include -I
c:\mysql\include -L mysqlclient
///////////
C:\MinGW\bin>g++ -c custom1.cpp -I c:\mysql++\include -I c:\mysql\include
C:\MinGW\bin>g++ -o custom custom1.o -I c:\mysql++\include -I
c:\mysql\include -I mysqlclient -I c:\mysql\lib\opt
//////////////
and etc...
i use gcc,mingw,and sqlapi,this api returne same error
i use mysql 5,4,3 to examine release dependency of mysql++ .
i'm tired.please help me. i need this.
---------------------------------
Do you Yahoo!?
Next-gen email? Have it all with the all-new Yahoo! Mail Beta.