我尝试使用Alien在Ubuntu 14.04上安装Orion上下文Broker但是当我执行contextBroker启动它时说:
contextBroker:加载共享库时出错:libboost_thread-mt.so.5:无法打开共享对象文件:没有这样的文件或目录
我无法找到错误的位置,然后我尝试使用Git中的说明安装所有依赖项,但是当我尝试make时它会出错:
[26%]构建CXX对象src / lib / serviceRoutines / CMakeFiles / serviceRoutines.dir / exitTreat.cpp.o 在/home/sistemas/fiware-orion-develop/src/lib/serviceRoutines/exitTreat.cpp:32:0中包含的文件中: /home/sistemas/fiware-orion-develop/src/lib/mongoBackend/MongoGlobal.h:30:35:致命错误:mongo / client / dbclient.h:没有exposit el archivo o el directorio #include" mongo / client / dbclient.h"
我安装了mongo的驱动程序,我该如何解决?
最后,我从https://github.com/mongodb/mongo-cxx-driver/releases编译一个新的驱动程序,并继续编译,直到:
*
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void recoverOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:532:40: error: ‘class mongo::OID’ has no member named ‘str’
std::string subId = idField.OID().str();
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void destroyOnTimeIntervalThread(std::string, mongo::BSONObj&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:583:40: error: ‘class mongo::OID’ has no member named ‘str’
std::string subId = idField.OID().str();
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp: In function ‘void releaseTriggeredSubscriptions(std::map<std::basic_string<char>, TriggeredSubscription*>&)’:
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: error: ‘string’ was not declared in this scope
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:17: note: suggested alternative:
In file included from /usr/include/c++/4.9/iosfwd:39:0,
from /usr/include/boost/smart_ptr/shared_ptr.hpp:49,
from /usr/include/boost/shared_ptr.hpp:17,
from /usr/include/mongo/client/dbclient_rs.h:20,
from /usr/include/mongo/client/dbclient.h:59,
from /home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:27:
/usr/include/c++/4.9/bits/stringfwd.h:62:33: note: ‘std::string’
typedef basic_string<char> string;
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 1 is invalid
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 3 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:47: error: template argument 4 is invalid
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: invalid type in declaration before ‘it’
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: expected ‘;’ before ‘it’
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:59: error: ‘it’ was not declared in this scope
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:94: error: expected ‘)’ before ‘;’ token
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:50: error: unused variable ‘iterator’ [-Werror=unused-variable]
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
/home/sistemas/fiware-orion/src/lib/mongoBackend/MongoGlobal.cpp:1911:98: error: ‘it’ was not declared in this scope
for (std::map<string, TriggeredSubscription*>::iterator it = subs.begin(); it != subs.end(); ++it)
^
cc1plus: all warnings being treated as errors
make[3]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/MongoGlobal.cpp.o] Error 1
make[3]: se sale del directorio «/home/sistemas/fiware-orion/BUILD_RELEASE»
make[2]: *** [src/lib/mongoBackend/CMakeFiles/mongoBackend.dir/all] Error 2
make[2]: *** Se espera a que terminen otras tareas....
[ 88%] Building CXX object src/lib/xmlParse/CMakeFiles/xmlParse.dir/xmlRegisterProviderRequest.cpp.o
*
Orion Context Broker文件中存在问题吗?
我认为这可能是de mongo的驱动程序再次出现问题,但我尝试安装另一个较旧的驱动程序并且它不起作用。我也认为这可能是de -mt库中的一个问题,它不再存在于boost中,但是到目前为止我没有尝试过。
答案 0 :(得分:2)
我使用Ubuntu 14.04 LTS作为主机安装了Orion CB。我还发现了libboost_thread-mt.so库的一些问题。解决了这个问题:
获取&amp;安装包 升压线程1.41.0-25.el6.x86_64.rpm 升压系统1.41.0-25.el6.x86_64.rpm 升压文件系统1.41.0-25.el6.x86_64.rpm
并使用外星人安装它们。然后,库安装在“/ usr / lib64”文件夹中。要纠正这个问题(CB能够找到它们):在“/etc/ld.so.conf.d/”中创建一个.conf文件,在其中添加一行(“/ usr / lib64”)并保存并退出并通过调用(“sudo ldconfig”)
重新加载您的配置希望这有帮助
答案 1 :(得分:0)
所以,我们在这里有两个问题。让我们从第一个开始,关于未找到共享库:
使用&#34; ldd $(which contextBroker)|询问经纪人库应该在哪里grep boost_thread)。 运行此命令后,请确保库在那里。如果不是,但你在其他地方有,那么应该能够使用env var LD_LIBRARY_PATH指向找到库的目录。
现在,对于第二个问题,找不到mongo驱动程序包含。在我的机器中,我将它们放在/ usr / local / include / mongo =&gt;我对编译器的 -I / usr / local / include 指令没问题。 如果您在其他地方安装了mongo驱动程序,则可能需要添加另一个&#39; include-directory&#39;为了汇编。这将在顶级CMakeLists.txt中完成(我猜是使用&#39; include_directories&#39; - 我远离cmake专家:-))。 在构建时,要查看详细信息,请按以下方式编译:
%CPU_COUNT = 1 VERBOSE = 1 make install
除非您设法解决问题,否则请在此处再次发布信息。