在一个c文件中 带有 sqlite3的函数包含了头文件 #include<sqlite3.h>
那个电脑里面也安装了sqlite3 数据库 但是在终端编译的时候出现如下错误 终端错误显示如下
xuelt@xuelt-desktop:~/testDTV$ gcc ts.c -o ts
ts.c: In function ‘Fileopen’:ts.c:708: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long long int’
/tmp/ccIVQT5q.o: In function `data_open_db':
ts.c:(.text+0x1f): undefined reference to `sqlite3_open'
/tmp/ccIVQT5q.o: In function `data_close_db':
ts.c:(.text+0x54): undefined reference to `sqlite3_close'
/tmp/ccIVQT5q.o: In function `create_table':
ts.c:(.text+0xcf): undefined reference to `sqlite3_exec'
ts.c:(.text+0x12c): undefined reference to `sqlite3_exec'
ts.c:(.text+0x189): undefined reference to `sqlite3_exec'
ts.c:(.text+0x1e6): undefined reference to `sqlite3_exec'
/tmp/ccIVQT5q.o: In function `sqlite_init':
ts.c:(.text+0x23b): undefined reference to `sqlite3_errmsg'
/tmp/ccIVQT5q.o: In function `store_eit_info':
ts.c:(.text+0x2fb): undefined reference to `sqlite3_exec'
/tmp/ccIVQT5q.o: In function `store_sdt_info':
ts.c:(.text+0x394): undefined reference to `sqlite3_exec'
/tmp/ccIVQT5q.o: In function `store_tdt_info':
ts.c:(.text+0x426): undefined reference to `sqlite3_exec'
/tmp/ccIVQT5q.o: In function `data_get_channel_list':
ts.c:(.text+0x4c1): undefined reference to `sqlite3_get_table'
/tmp/ccIVQT5q.o: In function `data_get_events_by_service_id_between':
ts.c:(.text+0x66f): undefined reference to `sqlite3_get_table'
/tmp/ccIVQT5q.o: In function `data_get_events_by_service_id_between_limit':
ts.c:(.text+0x894): undefined reference to `sqlite3_get_table'
/tmp/ccIVQT5q.o: In function `data_get_events_by_service_id_after':
ts.c:(.text+0xa76): undefined reference to `sqlite3_get_table'
/tmp/ccIVQT5q.o: In function `data_get_eit_info':
ts.c:(.text+0xd26): undefined reference to `sqlite3_get_table'
/tmp/ccIVQT5q.o:ts.c:(.text+0xf21): more undefined references to `sqlite3_get_table' follow
/tmp/ccIVQT5q.o: In function `data_book_insert':
ts.c:(.text+0x12c4): undefined reference to `sqlite3_free_table'
ts.c:(.text+0x1430): undefined reference to `sqlite3_exec'
collect2: ld returned 1 exit status
xuelt@xuelt-desktop:~/testDTV$