sylar-yin / sylar

C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
http://www.sylar.top
4.06k stars 973 forks source link

关于ZooKeeper C库的错误 #35

Open liwead opened 11 months ago

liwead commented 11 months ago

usr/bin/c++ -DDBUG_OFF -Dsylar_EXPORTS -DFILE=\"sylar/zk_client.cc\" -I/home/ly/pointer/sylar-master/. -I/apps/sylar/include -I/usr/include/mysql -rdynamic -O3 -fPIC -ggdb -std=c++11 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined -Wno-deprecated-declarations -fPIC -o CMakeFiles/sylar.dir/sylar/zk_client.cc.o -c /home/ly/pointer/sylar-master/sylar/zk_client.cc /home/ly/pointer/sylar-master/sylar/zk_client.cc:21:44: error: ‘ZOO_CONTAINER’ was not declared in this scope; did you mean ‘CONTAINER’? 21 | const int ZKClient::FlagsType::CONTAINER = ZOO_CONTAINER; | ^~~~~ | CONTAINER /home/ly/pointer/sylar-master/sylar/zk_client.cc:28:43: error: ‘ZOO_READONLY_STATE’ was not declared in this scope 28 | const int ZKClient::StateType::READONLY = ZOO_READONLY_STATE; | ^~~~~~ /home/ly/pointer/sylar-master/sylar/zk_client.cc:29:47: error: ‘ZOO_NOTCONNECTED_STATE’ was not declared in this scope; did you mean ‘ZOO_CONNECTED_STATE’? 29 | const int ZKClient::StateType::NOTCONNECTED = ZOO_NOTCONNECTED_STATE; | ^~~~~~ | ZOO_CONNECTED_STATE /home/ly/pointer/sylar-master/sylar/zk_client.cc: In member function ‘bool sylar::ZKClient::reconnect()’: /home/ly/pointer/sylar-master/sylar/zk_client.cc:52:16: error: ‘zookeeper_init2’ was not declared in this scope; did you mean ‘zookeeper_init’? 52 | m_handle = zookeeper_init2(m_hosts.c_str(), &ZKClient::OnWatcher, m_recvTimeout, nullptr, this, 0, m_logCb); | ^~~~~~~ | zookeeper_init /home/ly/pointer/sylar-master/sylar/zk_client.cc: In member function ‘bool sylar::ZKClient::init(const string&, int, sylar::ZKClient::watcher_callback, sylar::ZKClient::log_callback)’: /home/ly/pointer/sylar-master/sylar/zk_client.cc:67:16: error: ‘zookeeper_init2’ was not declared in this scope; did you mean ‘zookeeper_init’? 67 | m_handle = zookeeper_init2(hosts.c_str(), &ZKClient::OnWatcher, m_recvTimeout, nullptr, this, 0, lcb); | ^~~~~~~ | zookeeper_init /home/ly/pointer/sylar-master/sylar/zk_client.cc: In member function ‘int32_t sylar::ZKClient::setServers(const string&)’: /home/ly/pointer/sylar-master/sylar/zk_client.cc:72:15: error: ‘zoo_set_servers’ was not declared in this scope 72 | auto rt = zoo_set_servers(m_handle, hosts.c_str()); | ^~~~~~~ /home/ly/pointer/sylar-master/sylar/zk_client.cc: In member function ‘int32_t sylar::ZKClient::getConfig(std::string&, bool, Stat*)’: /home/ly/pointer/sylar-master/sylar/zk_client.cc:103:16: error: ‘ZOO_CONFIG_NODE’ was not declared in this scope 103 | return get(ZOO_CONFIG_NODE, val, watch, stat); | ^~~~~~~ /home/ly/pointer/sylar-master/sylar/zk_client.cc: In member function ‘std::string sylar::ZKClient::getCurrentServer()’: /home/ly/pointer/sylar-master/sylar/zk_client.cc:137:15: error: ‘zoo_get_current_server’ was not declared in this scope; did you mean ‘getCurrentServer’? 137 | auto rt = zoo_get_current_server(m_handle); | ^~~~~~ | getCurrentServer make[2]: [CMakeFiles/sylar.dir/build.make:865:CMakeFiles/sylar.dir/sylar/zk_client.cc.o] 错误 1 make[2]: 离开目录“/home/ly/pointer/sylar-master/build” make[1]: [CMakeFiles/Makefile2:248:CMakeFiles/sylar.dir/all] 错误 2 make[1]: 离开目录“/home/ly/pointer/sylar-master/build” make: *** [Makefile:87:all] 错误 2

@sylar-yin 作者大大这个问题怎么解决呀? 有大佬解释一下这个是如何解决的吗

lickysw commented 8 months ago

感觉是zookeeper版本不对,楼主有解决吗

lickysw commented 8 months ago

换成3.7.0的解决了已经

ssssaf commented 5 months ago

换成3.7.0的解决了已经

老哥,请教一下ubuntu如何更换这个版本

Yinhz19 commented 1 month ago

换成3.7.0的解决了已经

请问一下怎么安装的3.7.0 为什么我下载后面的版本都没有src/c文件夹