-2

MYSQL ライブラリを使用するプログラムをコンパイルしようとしています。これらは私のものです:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <mysql/mysql.h>

そして、これらはエラーです:

/tmp/ccs0iJn4.o: In function `toMysql':
ice2mysql2.c:(.text+0x32d): undefined reference to `mysql_init'
ice2mysql2.c:(.text+0x373): undefined reference to `mysql_real_connect'
ice2mysql2.c:(.text+0x38f): undefined reference to `mysql_query'
ice2mysql2.c:(.text+0x39d): undefined reference to `mysql_close'
/tmp/ccs0iJn4.o: In function `parseGlobalStats':
ice2mysql2.c:(.text+0x3f1): undefined reference to `xmlStrcmp'
ice2mysql2.c:(.text+0x412): undefined reference to `xmlNodeListGetString'
/tmp/ccs0iJn4.o: In function `parseStreamNet':
ice2mysql2.c:(.text+0x44f): undefined reference to `xmlStrcmp'
ice2mysql2.c:(.text+0x493): undefined reference to `xmlStrcmp'
ice2mysql2.c:(.text+0x4b4): undefined reference to `xmlNodeListGetString'
ice2mysql2.c:(.text+0x4cf): undefined reference to `xmlStrcmp'
ice2mysql2.c:(.text+0x4f0): undefined reference to `xmlNodeListGetString'
ice2mysql2.c:(.text+0x50b): undefined reference to `xmlStrcmp'
ice2mysql2.c:(.text+0x52c): undefined reference to `xmlNodeListGetString'
/tmp/ccs0iJn4.o: In function `parseDoc':
ice2mysql2.c:(.text+0x557): undefined reference to `xmlParseFile'
ice2mysql2.c:(.text+0x598): undefined reference to `xmlDocGetRootElement'
ice2mysql2.c:(.text+0x5d4): undefined reference to `xmlFreeDoc'
ice2mysql2.c:(.text+0x60e): undefined reference to `xmlFreeDoc'
collect2: ld returned 1 exit status

私はこれでコンパイルしています:

gcc -L/usr/lib/i386-linux-gnu -lxml2 -lmysqlclient -o ice2mysql2 ice2mysql2.c

プログラム全体を見たい場合:

プログラム

何が起こっているのか知りたいのですが、助けてください... Thx!

4

1 に答える 1