Closed sumkey closed 7 years ago
Scanning dependencies of target qconf_zk_static [ 5%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qconf_format.cc.o [ 11%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qconf_zk.cc.o [ 16%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qlibc/md5.c.o [ 22%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qlibc/qhash.c.o [ 27%] Linking CXX static library libqconf_zk.a [ 27%] Built target qconf_zk_static Scanning dependencies of target qconf_zk [ 33%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qconf_format.cc.o [ 38%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qconf_zk.cc.o [ 44%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qlibc/md5.c.o [ 50%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qlibc/qhash.c.o [ 55%] Linking CXX shared library libqconf_zk.so [ 55%] Built target qconf_zk [ 61%] Building C object demo/CMakeFiles/web_server.dir/mongoose.c.o [ 66%] Building C object demo/CMakeFiles/web_server.dir/web_server.c.o [ 72%] Linking C executable web_server [ 72%] Built target web_server Scanning dependencies of target qconf_manage.cgi [ 77%] Building CXX object demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc: In function ‘int loadconf(const string&)’: /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:227:72: error: no matching function for call to ‘make_pair(std::cxx11::string&, std::cxx11::string&)’ ret = _idc_conf_map.insert(make_pair<string, string>(idc, value)); ^ In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0, from /usr/include/c++/6/bits/stl_tree.h:63, from /usr/include/c++/6/map:60, from /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:14: /usr/include/c++/6/bits/stl_pair.h:493:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::decay_and_strip<_Tp>::type, typename std::decay_and_strip<_T2>::type> std::make_pair(_T1&&, _T2&&) make_pair(_T1&& x, _T2&& y) ^~~~~ /usr/include/c++/6/bits/stl_pair.h:493:5: note: template argument deduction/substitution failed: /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:227:72: note: cannot convert ‘idc’ (type ‘std::cxx11::string {aka std::__cxx11::basic_string}’) to type ‘std::cxx11::basic_string&&’ ret = _idc_conf_map.insert(make_pair<string, string>(idc, value)); ^ demo/page/CMakeFiles/qconf_manage.cgi.dir/build.make:62: recipe for target 'demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o' failed make[2]: [demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o] Error 1 CMakeFiles/Makefile2:236: recipe for target 'demo/page/CMakeFiles/qconf_manage.cgi.dir/all' failed make[1]: [demo/page/CMakeFiles/qconf_manage.cgi.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2
环境 php5.6 gcc (Debian 6.3.0-11) 6.3.0 20170321
在QConf/manager/demo/page/qconf_config.cc文件开始加一句#include <utility>再编译试试,可能是gcc版本不一样include的头文件有问题。
QConf/manager/demo/page/qconf_config.cc
#include <utility>
Scanning dependencies of target qconf_zk_static [ 5%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qconf_format.cc.o [ 11%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qconf_zk.cc.o [ 16%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qlibc/md5.c.o [ 22%] Building CXX object src/c/CMakeFiles/qconf_zk_static.dir/qlibc/qhash.c.o [ 27%] Linking CXX static library libqconf_zk.a [ 27%] Built target qconf_zk_static Scanning dependencies of target qconf_zk [ 33%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qconf_format.cc.o [ 38%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qconf_zk.cc.o [ 44%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qlibc/md5.c.o [ 50%] Building CXX object src/c/CMakeFiles/qconf_zk.dir/qlibc/qhash.c.o [ 55%] Linking CXX shared library libqconf_zk.so [ 55%] Built target qconf_zk [ 61%] Building C object demo/CMakeFiles/web_server.dir/mongoose.c.o [ 66%] Building C object demo/CMakeFiles/web_server.dir/web_server.c.o [ 72%] Linking C executable web_server [ 72%] Built target web_server Scanning dependencies of target qconf_manage.cgi [ 77%] Building CXX object demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc: In function ‘int loadconf(const string&)’: /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:227:72: error: no matching function for call to ‘make_pair(std::cxx11::string&, std::cxx11::string&)’ ret = _idc_conf_map.insert(make_pair<string, string>(idc, value)); ^ In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0, from /usr/include/c++/6/bits/stl_tree.h:63, from /usr/include/c++/6/map:60, from /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:14: /usr/include/c++/6/bits/stl_pair.h:493:5: note: candidate: template<class _T1, class _T2> constexpr std::pair<typename std::decay_and_strip<_Tp>::type, typename std::decay_and_strip<_T2>::type> std::make_pair(_T1&&, _T2&&) make_pair(_T1&& x, _T2&& y) ^}’) to type ‘std:: cxx11::basic_string&&’
ret = _idc_conf_map.insert(make_pair<string, string>(idc, value));
^
demo/page/CMakeFiles/qconf_manage.cgi.dir/build.make:62: recipe for target 'demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o' failed
make[2]: [demo/page/CMakeFiles/qconf_manage.cgi.dir/qconf_config.cc.o] Error 1
CMakeFiles/Makefile2:236: recipe for target 'demo/page/CMakeFiles/qconf_manage.cgi.dir/all' failed
make[1]: [demo/page/CMakeFiles/qconf_manage.cgi.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
~~~~ /usr/include/c++/6/bits/stl_pair.h:493:5: note: template argument deduction/substitution failed: /home/alibeibei/soft/QConf/manager/demo/page/qconf_config.cc:227:72: note: cannot convert ‘idc’ (type ‘std::cxx11::string {aka std::__cxx11::basic_string环境 php5.6 gcc (Debian 6.3.0-11) 6.3.0 20170321