错误信息:
/tmp/cc3joSwp.o: In function `main':
execSqlite.c:(.text+0x100): undefined reference to `sqlite3_open'
execSqlite.c:(.text+0x16c): undefined reference to `sqlite3_exec'
execSqlite.c:(.text+0x174): undefined reference to `sqlite3_close'
execSqlite.c:(.text+0x190): undefined reference to `sqlite3_errmsg'
collect2: error: ld returned 1 exit status
必须要连接到sqlite的库才能编译成功
gcc execSqlite.c -lsqlite3 -o testsql
link库前:
link库后: