Archiv verlassen und diese Seite im Standarddesign anzeigen : c++ und mysql
BLUESCREEN3D
10-04-2003, 16:39
Ich habe mir von http://www.mysql.com/downloads/api-mysql++.html MySQL++ runtergeladen (die "RPM for Red Hat 8.0 with gcc 3.2") und installiert.
Jetzt will ich das Beispielprogramm von http://www.mysql.com/documentation/mysql++/4_Tutorial.html kompilieren, aber ich kriege das irgendwie nicht hin...
# locate simple1.cc
/usr/share/doc/mysql++-1.7.9/examples/simple1.cc
# cd /usr/share/doc/mysql++-1.7.9/examples
# ls
cgi_image complic1.o custom2.cc custom4 fieldinf1.o Makefile.am resetdb.o sinisa_ex.cc util.cc
cgi_image.cc custom1 custom2.o custom4.cc load_file Makefile.in simple1 sinisa_ex.o util.hh
cgi_image.o custom1.cc custom3 custom4.o load_file.cc populate.cc simple1.cc updel_ex util.o
complic1 custom1.o custom3.cc fieldinf1 load_file.o resetdb simple1.o updel_x_.cc
complic1.cc custom2 custom3.o fieldinf1.cc Makefile resetdb.cc sinisa_ex updel_x_.o
# g++ -o simple1.out simple1.cc
simple1.cc:3:22: sqlplus.hh: Datei oder Verzeichnis nicht gefunden
simple1.cc: In function `int main()':
simple1.cc:13: `Connection' undeclared (first use this function)
simple1.cc:13: (Each undeclared identifier is reported only once for each
function it appears in.)
simple1.cc:13: parse error before `(' token
simple1.cc:14: `Query' undeclared (first use this function)
simple1.cc:17: `query' undeclared (first use this function)
simple1.cc:20: `Result' undeclared (first use this function)
simple1.cc:20: parse error before `=' token
simple1.cc:23: `cout' undeclared (first use this function)
simple1.cc:23: `endl' undeclared (first use this function)
simple1.cc:27: `res' undeclared (first use this function)
simple1.cc:29: `Row' undeclared (first use this function)
simple1.cc:29: parse error before `;' token
simple1.cc:30: `ios' undeclared (first use this function)
simple1.cc:30: parse error before `::' token
simple1.cc:38: parse error before `::' token
simple1.cc:40: `i' undeclared (first use this function)
simple1.cc:41: `row' undeclared (first use this function)
simple1.cc:50: parse error before `&' token
simple1.cc: At global scope:
simple1.cc:58: parse error before `catch'
You have new mail in /var/spool/mail/root
# locate sqlplus.hh
/usr/include/sqlplus/sqlplus.hh
wie mache ich g++ jetzt klar wo die datei ist?
Ändere doch einfach in deinem Testprogram
#include <sqlplus.hh>
nach
#include <sqlplus/sqlplus.hh>
das müsste helfen.
Alternativ kannst du mit der -I Option dem
compiler sagen wo er nach includes suchen kann:
g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/
gruss
Arthur
anda_skoa
10-04-2003, 17:59
Nachdem da ein Makefile ist, würde ich
#> make
vorschlagen :)
Ciao,
_
BLUESCREEN3D
11-04-2003, 01:39
bei g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/ kriege ich ganz genau 1534 zeilen fehlermeldungen! ******** :mad:
sowas passiert mir irgendwie immer, wenn ich beispielprogramme kompilieren will
wahrscheinlich mache ich irgendwas grundlegendes falsch - also mal der anfang der fehlermeldungen:
In file included from /usr/include/sqlplus/sqlplus.hh:9,
from simple1.cc:3:
/usr/include/sqlplus/defs:5:19: mysql.h: Datei oder Verzeichnis nicht gefunden
In file included from /usr/include/sqlplus/sqlplus.hh:9,
from simple1.cc:3:
/usr/include/sqlplus/defs:19: syntax error before `;' token
In file included from /usr/include/sqlplus/coldata1.hh:8,
from /usr/include/sqlplus/sqlplus.hh:12,
from simple1.cc:3:
/usr/include/sqlplus/type_info1.hh:10:19: mysql.h: Datei oder Verzeichnis nicht gefunden
In file included from /usr/include/sqlplus/coldata1.hh:8,
from /usr/include/sqlplus/sqlplus.hh:12,
from simple1.cc:3:
/usr/include/sqlplus/type_info1.hh:76: `enum_field_types' was not declared in
this scope
/usr/include/sqlplus/type_info1.hh:76: parse error before `,' token
/usr/include/sqlplus/type_info1.hh:90: parse error before `t'
/usr/include/sqlplus/type_info1.hh:93: parse error before `&' token
/usr/include/sqlplus/type_info1.hh:157: parse error before `t'
/usr/include/sqlplus/type_info1.hh:162: parse error before `&' token
/usr/include/sqlplus/type_info1.hh:164: ISO C++ forbids declaration of `_length
' with no type
/usr/include/sqlplus/type_info1.hh:164: `f' was not declared in this scope
/usr/include/sqlplus/type_info1.hh:164: ISO C++ forbids declaration of `
_max_length' with no type
/usr/include/sqlplus/type_info1.hh:164: `f' was not declared in this scope
/usr/include/sqlplus/type_info1.hh:165: parse error before `}' token
In file included from /usr/include/c++/3.2/backward/iterator.h:30,
from /usr/include/sqlplus/resiter1.hh:6,
from /usr/include/sqlplus/row1.hh:10,
from /usr/include/sqlplus/compare1.hh:6,
from /usr/include/sqlplus/sqlplus.hh:13,
from simple1.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
BLUESCREEN3D
11-04-2003, 01:40
btw: make hilft auch nicht
# make
source='resetdb.cc' object='resetdb.o' libtool=no \
depfile='.deps/resetdb.Po' tmpdepfile='.deps/resetdb.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../sqlplusint -I../sqlplusint -I/usr/include/mysql -g -O2 -c -o resetdb.o `test -f 'resetdb.cc' || echo
'./'`resetdb.cc
../depcomp: ../depcomp: Datei oder Verzeichnis nicht gefunden
make: *** [resetdb.o] Fehler 127
ist das jetzt fehler nr. 127 oder bedeutet das, dass 127 fehler aufgetreten sind?
das makefile hab ich übersehen ;)
aber ich hab mir mal kurz das packet angeschaut und da ist doch
im hauptverzeichnis ein build.sh, der eigentlich alles bauen sollte.
gruss
Arthur
BLUESCREEN3D
12-04-2003, 01:20
# updatedb
# locate build.sh
#
hmm... die datei gibt es nicht...
was genau hast du dir runtergeladen? auch die rpm? und in welchem verzeichnis sollte die datei dann sein?
ich hatte die source distribution gezogen (war halt der erste link;))
und dort ist noch das ganze build system dabei.
also versuch es vielleicht damit, oder du machst per hand weiter
und zeigst ihm halt was er zum kompilieren braucht d.h. als nächstes
>locate mysql.h
/usr/include/xxx/yyyy
>g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/ -I /usr/include/xxx/yyyy
usw.
gruss
Arthur
BLUESCREEN3D
12-04-2003, 18:19
# locate mysql.h
/usr/include/mysql/mysql.h
# g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/ -I /usr/include/mysql/
In file included from /usr/include/c++/3.2/backward/iterator.h:30,
from /usr/include/sqlplus/resiter1.hh:6,
from /usr/include/sqlplus/row1.hh:10,
from /usr/include/sqlplus/compare1.hh:6,
from /usr/include/sqlplus/sqlplus.hh:13,
from simple1.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
/tmp/ccUiUJPC.o: In function `main':
/tmp/ccUiUJPC.o(.text+0x36): undefined reference to `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, bool)'
/tmp/ccUiUJPC.o(.text+0x54d): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, mysql_ColData<const_string> const&)'
/tmp/ccUiUJPC.o(.text+0x800): undefined reference to `MysqlConnection::~MysqlConnection [in-charge]()'
/tmp/ccUiUJPC.o(.text+0x820): undefined reference to `MysqlConnection::~MysqlConnection [in-charge]()'
/tmp/ccUiUJPC.o: In function `MysqlRes::~MysqlRes [in-charge]()':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN8MysqlResD1Ev+0x1a): undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
/tmp/ccUiUJPC.o: In function `MysqlQuery::preview()':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN10MysqlQuery7preview Ev+0x1b): undefined reference to `SQLQuery::str(SQLQueryParms const&) const'
/tmp/ccUiUJPC.o: In function `MysqlRes::~MysqlRes [in-charge deleting]()':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN8MysqlResD0Ev+0x1a): undefined reference to `MysqlResUse::~MysqlResUse [not-in-charge]()'
/tmp/ccUiUJPC.o: In function `MysqlRes::num_rows() const':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZNK8MysqlRes8num_rowsE v+0x13): undefined reference to `mysql_num_rows'
/tmp/ccUiUJPC.o: In function `MysqlQuery::store(SQLQueryParms&, query_reset)':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN10MysqlQuery5storeER 13SQLQueryParms11query_reset+0x38): undefined reference to `SQLQuery::str(SQLQueryParms const&, query_reset)'
/tmp/ccUiUJPC.o: In function `MysqlFieldNames::MysqlFieldNames[in-charge](MysqlResUse const*)':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN15MysqlFieldNamesC1E PK11MysqlResUse+0x66): undefined reference to `MysqlFieldNames::init(MysqlResUse const*)'
/tmp/ccUiUJPC.o: In function `MysqlResUse::num_fields() const':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZNK11MysqlResUse10num_ fieldsEv+0x10): undefined reference to `mysql_num_fields'
/tmp/ccUiUJPC.o: In function `MysqlRes::fetch_row() const':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZNK8MysqlRes9fetch_row Ev+0x135): undefined reference to `mysql_fetch_row'
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZNK8MysqlRes9fetch_row Ev+0x14c): undefined reference to `mysql_fetch_lengths'
/tmp/ccUiUJPC.o: In function `MysqlRes::data_seek(unsigned) const':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZNK8MysqlRes9data_seek Ej+0x1d): undefined reference to `mysql_data_seek'
/tmp/ccUiUJPC.o: In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN15MysqlConnection5st oreERKSs+0x19): undefined reference to `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)'
/tmp/ccUiUJPC.o: In function `FieldTypes::FieldTypes[in-charge](MysqlResUse const*)':
/tmp/ccUiUJPC.o(.gnu.linkonce.t._ZN10FieldTypesC1EPK11M ysqlResUse+0x66): undefined reference to `FieldTypes::init(MysqlResUse const*)'
collect2: ld returned 1 exit status
jetzt weiss ich nicht mehr weiter...
(sind das mit dem /tmp/bla... alles nur warnungen oder fehler?)
sieht doch gut aus ;)
kompilieren tut es doch schon, es happert jetzt nur noch beim
linken, er findet nicht die libsqlplus bibliothek.
>locate libsqlplus
...
/usr/lib/xxx/yyy/libsqlplus.so
...
>g++ ....... -L /usr/lib/xxx/yyy -lsqlplus
das sollte dann genügen (hoffe ich doch)
anda_skoa
12-04-2003, 18:37
Original geschrieben von BLUESCREEN3D
In file included from /usr/include/c++/3.2/backward/iterator.h:30,
from /usr/include/sqlplus/resiter1.hh:6,
from /usr/include/sqlplus/row1.hh:10,
from /usr/include/sqlplus/compare1.hh:6,
from /usr/include/sqlplus/sqlplus.hh:13,
from simple1.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
Das ist eine Warning.
Die Datei resiter1.hh inkludiert einen alten C++ Header.
iterator.h statt iterator
/tmp/ccUiUJPC.o: In function `main':
/tmp/ccUiUJPC.o(.text+0x36): undefined reference to `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, bool)'
/tmp/ccUiUJPC.o(.text+0x54d): undefined reference to `operator<<(std::basic_ostream<char, std::char_traits<char> >&, mysql_ColData<const_string> const&)'
/tmp/ccUiUJPC.o(.text+0x800): undefined reference to `MysqlConnection::~MysqlConnection [in-charge]()'
Diese Sachen sind Fehlermeldungen des Linkers.
Hier fehlt offensichtlich unter anderem die ganze MysqlConnection Klasse.
Wenn du die Datei simple.cc nur Compilieren willst, musst du den -c switch verwenden.
Beim Linken zur Applikation musst du dann alle Objectfiles angeben.
Ciao,
_
BLUESCREEN3D
13-04-2003, 16:03
scheint zu gehen :)
# locate libsqlplus
/usr/lib/libsqlplus.so.1.0.0
/usr/lib/libsqlplus.a
/usr/lib/libsqlplus.la
/usr/lib/libsqlplus.so
/usr/lib/libsqlplus.so.0
/usr/lib/libsqlplus.so.1
# g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/ -I /usr/include/mysql/ -L /usr/lib -lsqlplus
In file included from /usr/include/c++/3.2/backward/iterator.h:30,
from /usr/include/sqlplus/resiter1.hh:6,
from /usr/include/sqlplus/row1.hh:10,
from /usr/include/sqlplus/compare1.hh:6,
from /usr/include/sqlplus/sqlplus.hh:13,
from simple1.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
# ls simple*
simple1 simple1.cc simple1.o simple1.out
edit:
jo, funzt gut :D
ich musste zwar die db auf die das proggi zugreifen wollte von hand erstellen und darin eine tabelle erstellen weil das resetdb-script von anfang an nicht funzte aber das passt schon... das schwierigste ist eben das compilieren ^^
jetzt die nächste frage: wenn ich das auf meinem system kompiliere, aber dann versuche das fertige proggi auf nem anderen rechner zu starten, dann kriege ich folgenden fehler:
error while loading shared libraries: libsqlplus.so.1: cannot open shared object file: No such file or directory
jetzt muss ich wohl auf dem rechner auch das komplette mysql++-paket installieren, oder gibt es eine möglichkeit diese libsqlplus.so.1 irgendwie mit einzukompilieren?
anda_skoa
13-04-2003, 16:56
Du kannst die Lib statisch linken.
Dazu musst du vor -lsqlplus noch die Option -static angeben.
Statisches Linken halte ich allerdings für eine Unart.
Ciao,
_
versuch mal mit:
# g++ -o simple1.out simple1.cc -I /usr/include/sqlplus/
-I /usr/include/mysql/ /usr/lib/libsqlplus.a
oder mit -static ;)
damit verlinkst du die benötigten teile statisch mit deinem program,
es wird dann entsprechend grösser.
gruss
Arthur
BLUESCREEN3D
13-04-2003, 17:53
statisch verlinken scheint der compiler nicht zu mögen
bei
g++ -o simple1.2.out simple1.cc -I /usr/include/sqlplus/ -I /usr/include/mysql/ -L /usr/lib -static -lsqlplus
und bei
g++ -o simple1.2.out simple1.cc -I /usr/include/sqlplus/ -I /usr/include/mysql/ /usr/lib/libsqlplus.a
kriege ich folgende meldung:
In file included from /usr/include/c++/3.2/backward/iterator.h:30,
from /usr/include/sqlplus/resiter1.hh:6,
from /usr/include/sqlplus/row1.hh:10,
from /usr/include/sqlplus/compare1.hh:6,
from /usr/include/sqlplus/sqlplus.hh:13,
from simple1.cc:3:
/usr/include/c++/3.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
/tmp/ccmwX7lp.o: In function `MysqlRes::num_rows() const':
/tmp/ccmwX7lp.o(.gnu.linkonce.t._ZNK8MysqlRes8num_rowsE v+0x13): undefined reference to `mysql_num_rows'
/tmp/ccmwX7lp.o: In function `MysqlResUse::num_fields() const':
/tmp/ccmwX7lp.o(.gnu.linkonce.t._ZNK11MysqlResUse10num_ fieldsEv+0x10): undefined reference to `mysql_num_fields'
/tmp/ccmwX7lp.o: In function `MysqlRes::fetch_row() const':
/tmp/ccmwX7lp.o(.gnu.linkonce.t._ZNK8MysqlRes9fetch_row Ev+0x135): undefined reference to `mysql_fetch_row'
/tmp/ccmwX7lp.o(.gnu.linkonce.t._ZNK8MysqlRes9fetch_row Ev+0x14c): undefined reference to `mysql_fetch_lengths'
/tmp/ccmwX7lp.o: In function `MysqlRes::data_seek(unsigned) const':
/tmp/ccmwX7lp.o(.gnu.linkonce.t._ZNK8MysqlRes9data_seek Ej+0x1d): undefined reference to `mysql_data_seek'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[not-in-charge](char const*, char const*, char const*, char const*, bool)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:9: undefined reference to `mysql_init'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[not-in-charge](char const*, char const*, char const*, char const*, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, bool)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:9: undefined reference to `mysql_init'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[not-in-charge](char const*, char const*, char const*, char const*, unsigned, char, unsigned, bool, char const*, unsigned)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:28: undefined reference to `mysql_init'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[not-in-charge](char const*, char const*, char const*, char const*, unsigned, char, unsigned, bool, char const*, unsigned)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, unsigned, char, unsigned, bool, char const*, unsigned)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:28: undefined reference to `mysql_init'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::MysqlConnection[in-charge](char const*, char const*, char const*, char const*, unsigned, char, unsigned, bool, char const*, unsigned)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::real_connect(char const*, char const*, char const*, char const*, unsigned, char, unsigned, char const*, unsigned)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:50: undefined reference to `mysql_options'
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:52: undefined reference to `mysql_real_connect'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::real_connect(char const*, char const*, char const*, char const*, unsigned, char, unsigned, char const*, unsigned)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::select_db(char const*)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:74: undefined reference to `mysql_select_db'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::select_db(char const*)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::reload()':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:80: undefined reference to `mysql_refresh'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::reload()':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::shutdown()':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:86: undefined reference to `mysql_shutdown'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::shutdown()':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::connect(char const*, char const*, char const*, char const*)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:94: undefined reference to `mysql_options'
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:96: undefined reference to `mysql_real_connect'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::connect(char const*, char const*, char const*, char const*)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::info()':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:112: undefined reference to `mysql_info'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::execute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::execute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_query'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::execute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::execute(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection1.hh:110: undefined reference to `mysql_insert_id'
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection1.hh:109: undefined reference to `mysql_affected_rows'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::exec(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_query'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::exec(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_query'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::store(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/result1.hh:158: undefined reference to `mysql_store_result'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::use(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::use(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_query'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::use(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/include/c++/3.2/bits/stl_alloc.h:630: undefined reference to `mysql_error'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::use(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:160: undefined reference to `mysql_use_result'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::~MysqlConnection [not-in-charge]()':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:70: undefined reference to `mysql_close'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlConnection::~MysqlConnection [in-charge]()':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:70: undefined reference to `mysql_close'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlFields::size() const':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:9: undefined reference to `mysql_num_fields'
/usr/lib/libsqlplus.a(connection.o): In function `MysqlFields::operator[](unsigned) const':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:8: undefined reference to `mysql_field_seek'
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/connection.cc:9: undefined reference to `mysql_fetch_field'
/usr/lib/libsqlplus.a(field_names.o): In function `MysqlFieldNames::init(MysqlResUse const*)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/result1.hh:62: undefined reference to `mysql_num_fields'
/usr/lib/libsqlplus.a(field_types.o): In function `FieldTypes::init(MysqlResUse const*)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/result1.hh:62: undefined reference to `mysql_num_fields'
/usr/lib/libsqlplus.a(manip.o): In function `operator<<(quote_type2, SQLString&)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_escape_string'
/usr/lib/libsqlplus.a(manip.o): In function `std::basic_ostream<char, std::char_traits<char> >& operator<< <std::basic_string<char, std::char_traits<char>, std::allocator<char> > >(quote_type1, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_escape_string'
/usr/lib/libsqlplus.a(manip.o): In function `std::basic_ostream<char, std::char_traits<char> >& operator<< <char const*>(quote_type1, char const* const&)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/manip.cc:43: undefined reference to `mysql_escape_string'
/usr/lib/libsqlplus.a(manip.o): In function `std::basic_ostream<char, std::char_traits<char> >& operator<< <mysql_ColData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(quote_type1, mysql_ColData<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_escape_string'
/usr/lib/libsqlplus.a(manip.o): In function `std::basic_ostream<char, std::char_traits<char> >& operator<< <mysql_ColData<const_string> >(quote_type1, mysql_ColData<const_string> const&)':
/usr/src/redhat/BUILD/mysql++-1.7.9/sqlplusint/const_string1.hh:54: undefined reference to `mysql_escape_string'
/usr/lib/libsqlplus.a(manip.o):/usr/include/c++/3.2/bits/basic_string.h:781: more undefined references to `mysql_escape_string' follow
/usr/lib/libsqlplus.a(result.o): In function `MysqlResUse::~MysqlResUse [not-in-charge]()':
/usr/include/c++/3.2/bits/stl_vector.h:123: undefined reference to `mysql_free_result'
/usr/lib/libsqlplus.a(result.o): In function `MysqlResUse::~MysqlResUse [in-charge]()':
/usr/include/c++/3.2/bits/stl_vector.h:123: undefined reference to `mysql_free_result'
/usr/lib/libsqlplus.a(result.o): In function `MysqlResUse::copy(MysqlResUse const&)':
/usr/include/c++/3.2/bits/stl_vector.h:123: undefined reference to `mysql_free_result'
/usr/lib/libsqlplus.a(sql_query.o): In function `pprepare(char, SQLString&, bool)':
/usr/include/c++/3.2/bits/basic_string.h:781: undefined reference to `mysql_escape_string'
collect2: ld returned 1 exit status
Vielleicht ein bißchen spät gefragt, aber woher bekomme ich die sqlplus.hh?
Habe die Mysqlc++ api installiert, aber der header ist net dabei....
Thx.
locus vivendi
16-10-2004, 19:45
Wenn ich dir einen Rat geben darf: Benutze nicht das C++ api welches Mysql direkt anbietet. Das ist total veraltet und gravierend fehlerhaft. Benutze entweder das api von mysqlcppapi.sourceforge.net oder gleich OTL von otl.sourceforge.net. Letzeres habe ich zwar selber noch nicht benutzt, aber es macht zumindest der Doku auf der Seite nach einen guten Eindruck.
Powered by vBulletin® Version 4.2.5 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.