LINUX编译时缺少头文件,查找依赖库的终极解决办法

  在LINUX上编译,经常缺少头文件。如果不知道哪个库,就要上网搜索。有时很快找到,有时找不到。有没有一个彻底的解决办法?有。

  • 安装并更新
apt install apt-file
apt update
  • 报错
src/switch_core.c:54:10: fatal error: sqlite3.h: 没有那个文件或目录
 #include <sqlite3.h>
  • 需要什么库
root@freeswitch:/home/quantum6/freeswitch# apt-file search sqlite3.h
aolserver4-nssqlite3: /usr/share/doc/aolserver4-nssqlite3/nssqlite3.html
autoconf-archive: /usr/share/doc/autoconf-archive/html/ax_005flib_005fsqlite3.html
cl-sql: /usr/share/doc/cl-sql/html/sqlite3.html
db5.3-doc: /usr/share/doc/db5.3-doc/api_reference/C/sqlite3.html
db5.3-doc: /usr/share/doc/db5.3-doc/api_reference/CXX/sqlite3.html
emscripten: /usr/share/emscripten/tests/sqlite/sqlite3.h
erlang-p1-sqlite3: /usr/lib/erlang/lib/p1_sqlite3-1.1.5/include/sqlite3.hrl
erlang-sqlite3: /usr/lib/erlang/lib/sqlite3-1.1.4~dfsg0/include/sqlite3.hrl
glusterfs-common: /usr/include/glusterfs/gfdb/gfdb_sqlite3.h
hhvm-dev: /usr/include/hphp/runtime/ext/sqlite3/ext_sqlite3.h
libbotan-2-dev: /usr/include/botan-2/botan/sqlite3.h
libghc-haskelldb-hdbc-sqlite3-doc: /usr/lib/ghc-doc/haddock/haskelldb-hdbc-sqlite3-2.1.2/haskelldb-hdbc-sqlite3.haddock
libghc-hdbc-sqlite3-doc: /usr/lib/ghc-doc/haddock/hdbc-sqlite3-2.3.3.1/HDBC-sqlite3.haddock
libmstoolkit-dev: /usr/include/libmstoolkit/sqlite3.h
libsoci-dev: /usr/include/soci/sqlite3/soci-sqlite3.h
libspatialite-dev: /usr/include/spatialite/sqlite3.h
libsqlcipher-dev: /usr/include/sqlcipher/sqlite3.h
libsqlite3-dev: /usr/include/sqlite3.h
libtsk-dev: /usr/include/tsk/auto/sqlite3.h
libwxsqlite3-3.0-dev: /usr/include/wx-3.0/wx/wxsqlite3.h
lisaac-common: /usr/share/lisaac/lib/unstable/sqlite-binding/sqlite3.h
lua-dbi-sqlite3-dev: /usr/include/lua5.1/lua-dbi-sqlite3.h
lua-sql-sqlite3-dev: /usr/include/lua5.1/lua-sql-sqlite3.h
lua-sql-sqlite3-dev: /usr/include/lua5.2/lua-sql-sqlite3.h
lua-sql-sqlite3-dev: /usr/include/lua5.3/lua-sql-sqlite3.h
nim-doc: /usr/share/doc/nim-doc/html/sqlite3.html
php-doc: /usr/share/doc/php-doc/html/book.sqlite3.html
php-doc: /usr/share/doc/php-doc/html/intro.sqlite3.html
python-flask-doc: /usr/share/doc/python-flask-doc/html/patterns/sqlite3.html
python-pysqlite2-doc: /usr/share/doc/python-pysqlite2-doc/html/sqlite3.html
python2.7-doc: /usr/share/doc/python2.7/html/library/sqlite3.html
python3.5-doc: /usr/share/doc/python3.5/html/library/sqlite3.html
python3.6-doc: /usr/share/doc/python3.6/html/library/sqlite3.html
python3.7-doc: /usr/share/doc/python3.7/html/library/sqlite3.html
qtcreator-dev: /usr/src/qtcreator/src/libs/3rdparty/sqlite/sqlite3.h
r-cran-rsqlite: /usr/lib/R/site-library/RSQLite/include/sqlite3.h
salt-doc: /usr/share/doc/salt/html/ref/modules/all/salt.modules.sqlite3.html
salt-doc: /usr/share/doc/salt/html/ref/pillar/all/salt.pillar.sqlite3.html
salt-doc: /usr/share/doc/salt/html/ref/sdb/all/salt.sdb.sqlite3.html
salt-doc: /usr/share/doc/salt/html/ref/states/all/salt.states.sqlite3.html
sqlite3-doc: /usr/share/doc/sqlite3-doc/c3ref/sqlite3.html
thunderbird-dev: /usr/include/thunderbird/sqlite3.h
  • 安装
apt install libsqlite3-dev
上一篇:不想重复工作怎么办?教你一键批量操作,群发、采集不用愁!


下一篇:Angular rxjs里自定义operator的使用