问题描述
我正在使用poco库连接到mongodb。我的代码正在编译,但是在用尽文件时却出现以下错误
let marks = JSON.parse(localstorage.getItem('marks')) || [];
const addMarks = () => {
localstorage.setItem('marks',JSON.stringify(['10']))
}
libPocoMongoDB.so.71已存在于/ usr / local / lib
这是我的c ++代码
./test_mongo: error while loading shared libraries: libPocoMongoDB.so.71: cannot open shared object file: No such file or directory
我使用以下命令对其进行了编译
#include "Poco/MongoDB/MongoDB.h"
#include "Poco/MongoDB/Connection.h"
#include "Poco/MongoDB/Database.h"
#include "Poco/MongoDB/Cursor.h"
#include "Poco/MongoDB/Array.h"
int main(int argc,char** argv)
{
try
{
Poco::MongoDB::Connection connection("localhost",27017);
}
catch (Poco::Exception& exc)
{
std::cerr << exc.displayText() << std::endl;
}
return 0;
}
解决方法
有两种解决方法
- 尝试使用ldconfig命令。
- 只需将所有库从/ usr / local / lib移至/ usr / lib。