安装QConf 报错及解决方案
生活随笔
收集整理的這篇文章主要介紹了
安装QConf 报错及解决方案
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1:提示找不到gdbm.h頭文件
/alidata/QConf/agent/qconf_dump.cc:1:18: fatal error: gdbm.h: No such file or directory compilation terminated. agent/CMakeFiles/qconf_agent.dir/build.make:206: recipe for target 'agent/CMakeFiles/qconf_agent.dir/qconf_dump.cc.o' failed make[2]: *** [agent/CMakeFiles/qconf_agent.dir/qconf_dump.cc.o] Error 1 CMakeFiles/Makefile2:85: recipe for target 'agent/CMakeFiles/qconf_agent.dir/all' failed make[1]: *** [agent/CMakeFiles/qconf_agent.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
解決方法:
安裝一個(gè)gdbm庫(kù) $ apt install libgdbm-dev
2 invalid conversion from ‘const char*’ to ‘char*’
QConf/agent/qconf_dump.cc:63:50: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
_qconf_dbf = gdbm_open(_qconf_dump_file.c_str(), 0, flags, mode, NULL);
^
In file included from /root/QConf/agent/qconf_dump.cc:1:0:
/usr/include/gdbm.h:85:18: note: initializing argument 1 of ‘<anonymous struct>* gdbm_open(char*, int, int, int, void (*)())’
解決方法:
打開文件 agent/qconf_dump.cc 找到63行 gdbm_open 第一個(gè)參數(shù)應(yīng)該是 char* 類型 而 _qconf_dump_file.c_str() 返回的是 const char* 類型 轉(zhuǎn)換一下即可 原來的是: qconf_dbf = gdbm_open(qconf_dump_file.c_str(), 0, flags, mode, NULL); 改成: char* cc; strcpy(cc,_qconf_dump_file.c_str()); qconf_dbf = gdbm_open(cc, 0, flags, mode, NULL);
3提示找不到libgdbm.a文件
make[2]: *** No rule to make target `../agent/../deps/gdbm/_install/lib/libgdbm.a', needed by `agent/qconf_agent'. Stop. make[1]: *** [agent/CMakeFiles/qconf_agent.dir/all] Error 2 make: *** [all] Error 2
解決方法:
去搜索一下系統(tǒng)是否已經(jīng)有文件 $find / -name "libgdbm.a" 如果能夠搜索到 比如我這邊就是在 /usr/lib/x86_64-linux-gnu/libgdbm.a 直接復(fù)制到 $cp /usr/lib/x86_64-linux-gnu/libgdbm.a deps/gdbm/_install/lib 如果系統(tǒng)中沒有 那么就直接下載:https://ftp.gnu.org/gnu/gdbm/ 然后編譯 再把文件拷過去
總結(jié)
以上是生活随笔為你收集整理的安装QConf 报错及解决方案的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: time zone issue in t
- 下一篇: python 的类变量和对象变量