如何用Cygwin安装Sqlite3?当我试图用Cygwin这样编译时:

gcc -o basics basics.c

上面写着:
/tmp/ccpS4NGr.o:basics.c:(.text+0x67):未定义的对_sqlite3_open' /tmp/ccpS4NGr.o:basics.c:(.text+0x10b): undefined reference to'u sqlite3'u exec'/tmp/ccpS4NGr.o:basics.c:(.text+0x172):未定义的对_sqlite3_exec' /tmp/ccpS4NGr.o:basics.c:(.text+0x1d9): undefined reference to'u sqlite3'u exec'/tmp/ccpS4NGr.o:basics.c:(.text+0x243):未定义的对_sqlite3_prepare_v2' /tmp/ccpS4NGr.o:basics.c:(.text+0x279): undefined reference to'u sqlite3'u column'count'/tmp/ccpS4NGr.o:basics.c:(.text+0x28f):未定义的参考文献,_sqlite3_step' /tmp/ccpS4NGr.o:basics.c:(.text+0x2cb): undefined reference to'u sqlite3'u column'count'/tmp/tmp/ccpS4NGr.com/ccpS4NGr.o到sqlite3列文本/tCMP/CCSPS4NGR.O:基本知识。C:(.text +0x2EC):未定义引用到_sqlite3_column_ name' /tmp/ccpS4NGr.o:basics.c:(.text+0x355): undefined reference to
我将sqlite3.h与sqlite合并包附带的其他3个文件放在basics.c的同一目录中

最佳答案

你是怎么算的?

#include <sqlite.h>


#include "sqlite.h"

后一个表单可能很有用;它将在include路径之前检查当前文件夹。

关于c - Sqlite3与cygwin,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7365059/

10-13 07:25