ubuntu sqlite3 undefined reference to `sqlite3_column_table_name'


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

/gdal-3.1.1/.libs/libgdal.so: undefined reference to `sqlite3_column_origin_name'
/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 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM