用C语言执行SQLite3的gcc编译细节

错误信息:

/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的库才能编译成功

cpp 复制代码
gcc execSqlite.c -lsqlite3 -o testsql

link库前:

link库后:

相关推荐
凡人叶枫10 分钟前
Effective C++ 条款15:在资源管理类中提供对原始资源的访问
linux·开发语言·c++·stm32·单片机
郝学胜-神的一滴10 分钟前
中级OpenGL教程 009:用环境光告别模型死黑
前端·c++·unity·godot·图形渲染·opengl·unreal
cccyi739 分钟前
C++ 面试题整理
c++·面试
代码中介商1 小时前
C++ 智能指针完全指南(二):shared_ptr 深度详解
开发语言·c++
WWW65261 小时前
代码随想录 打卡第五十四天
数据结构·c++·算法
redaijufeng2 小时前
我在C++中深入理解了继承,收获颇丰
java·c++·算法
.千余2 小时前
【C++】C++继承入门(上):继承语法与基本特性详解
开发语言·c++·笔记·学习·其他
哎呦,帅小伙哦2 小时前
一个通用的异步任务提交器
c++
闻道且行之2 小时前
Hair Segmentation:MediaPipe 头发分割模块 CMake 独立编译
c++·人工智能·深度学习·神经网络·opencv·计算机视觉
Irissgwe2 小时前
C++ STL 详解:list 的介绍使用与模拟实现
开发语言·c++·stl·list