mysql.h
-
nach g++ -o mysql mysql.cc kommt folgende ausgabe:
/tmp/cchpRG89.o: In function
main': /tmp/cchpRG89.o(.text+0x1d): undefined reference to
mysql_init'
/tmp/cchpRG89.o(.text+0x44): undefined reference tomysql\_real\_connect' /tmp/cchpRG89.o(.text+0x73): undefined reference to
mysql_query'
/tmp/cchpRG89.o(.text+0x91): undefined reference tomysql_error' /tmp/cchpRG89.o(.text+0xb9): undefined reference to
mysql_store_result'
/tmp/cchpRG89.o(.text+0xde): undefined reference tomysql\_fetch\_row' /tmp/cchpRG89.o(.text+0x10a): undefined reference to
mysql_num_fields'
/tmp/cchpRG89.o(.text+0x169): undefined reference tomysql_errno' /tmp/cchpRG89.o(.text+0x182): undefined reference to
mysql_error'
/tmp/cchpRG89.o(.text+0x1a9): undefined reference tomysql\_free\_result' /tmp/cchpRG89.o(.text+0x1b9): undefined reference to
mysql_close'
/tmp/cchpRG89.o(.text+0x1e1): undefined reference tomysql_errno' /tmp/cchpRG89.o(.text+0x1f7): undefined reference to
mysql_error'
/tmp/cchpRG89.o(.text+0x20a): undefined reference to `mysql_errno'
collect2: ld returned 1 exit statusdie selbe liste kommt bei verschiedenen codebeispielen also vermute ich das ich die mysql.h noch irgendwie beim compilieren einbauen muss oder so
bin relativ neu in sachen linux & c++ also nicht wundern
danke
-
Hallo,
probiers mal so:
g++ -o mysql mysql.cc -lmysql
-
CarstenJ schrieb:
Hallo,
probiers mal so:
g++ -o mysql mysql.cc -lmysql
danke mit -lmysqlclient funktioniert es