gpt4 book ai didi

c++ - mongoDB,C++ libmongoclient.so : cannot open shared object file: No such file or directory

转载 作者:行者123 更新时间:2023-11-28 03:41:44 25 4
gpt4 key购买 nike

当我在 cpp 中构建我的 cpp 项目时...这是输出。

**** Build of configuration Debug for project rtbCookieServer ****

make all
Building file: ../src/rtbCookieServer.cpp
Invoking: GCC C++ Compiler
g++ -I/home/cpp/mongo-cxx-driver-v2.0/mongo -I/home/cpp/mongo-cxx-driver-v2.0 -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/rtbCookieServer.d" -MT"src/rtbCookieServer.d" -o"src/rtbCookieServer.o" "../src/rtbCookieServer.cpp"
Finished building: ../src/rtbCookieServer.cpp

Building target: rtbCookieServer
Invoking: GCC C++ Linker
g++ -L/home/cpp/mongo-cxx-driver-v2.0 -lfcgi++ -lboost_system -lcgicc -lmongoclient -o"rtbCookieServer" ./src/rtbCookieServer.o
Finished building target: rtbCookieServer

W=当我运行代码时...这是我收到的错误消息。

/home/workspace/rtbCookieServer/Debug/rtbCookieServer: error while loading shared libraries: libmongoclient.so: cannot open shared object file: No such file or directory

文件在 home/cpp/mongo-cxx-driver-v2.0 为什么找不到呢????

谢谢

最佳答案

比使用 LD_LIBRARY_PATH 更好的是指定运行库搜索

-Wl,-rpath /home/cpp/mongo-cxx-driver-v2.0

有关为什么不使用 LD_LIBRARY_PATH 的更多信息,请查看例如here .

关于c++ - mongoDB,C++ libmongoclient.so : cannot open shared object file: No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8968845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com