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