构建 C++ 项目的 docker 镜像时,由于库链接问题,我在 docker 镜像中编译项目时遇到问题
位于 https://github.com/chinthakarukshan/jasminegraph/tree/master/docker 中的 Docker 文件location 在 ubuntu 基础镜像之上构建一个 docker 镜像,安装项目所需的必要库。编译项目时,我遇到了库链接问题,并且无法构建项目并出现以下错误。
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
make[3]: *** [JasmineGraph] Error 1
sqlite3 库已经安装在 Dockerfile 中。但是在链接库时失败。
下面是将 sqlite3 库与项目链接起来的 cmake 代码。
target_link_libraries(JasmineGraph sqlite3)
下面是相应 CMakeList 文件的链接。
https://github.com/chinthakarukshan/jasminegraph/blob/master/CMakeLists.txt
最佳答案
您需要安装开发版本:
RUN apt-get install -y libsqlite3-dev
关于c++ - CMake 链接库在 Docker 镜像中失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58807563/