首页 > 数据库技术 > 详细

ubuntu sqlite3 undefined reference to `sqlite3_column_table_name'

时间:2020-07-02 23:11:10      阅读:342      评论:0      收藏:0      [点我收藏+]

自己编译的sqlite3, 结果在编译gdal的时候出现

/usr/bin/ld: /home/xuqinghan/下载/gdal-3.1.1/.libs/libgdal.so: undefined reference to `sqlite3_column_origin_name‘
/usr/bin/ld: /home/xuqinghan/下载/gdal-3.1.1/.libs/libgdal.so: undefined reference to `sqlite3_column_table_name‘

google一番,发现是sqlite3需要配置一个宏

https://www.sqlite.org/compile.html

SQLITE_ENABLE_COLUMN_METADATA

When this C-preprocessor macro is defined, SQLite includes some additional APIs that provide convenient access to meta-data about tables and queries. The APIs that are enabled by this option are:

 

具体做法是在源码文件夹下

cd ./sqlite-autoconf-3320300

xed ./sqlite3.c

添加

#define SQLITE_CORE 1
#define SQLITE_AMALGAMATION 1
#ifndef SQLITE_PRIVATE
# define SQLITE_PRIVATE static
#endif
#define SQLITE_ENABLE_COLUMN_METADATA 1

/************** Begin file ctime.c *******************************************/
/*

然后

./configure

make

sudo make install 

 

ubuntu sqlite3 undefined reference to `sqlite3_column_table_name'

原文:https://www.cnblogs.com/xuanmanstein/p/13227545.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!