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
—————————————