Cylix / cpp_redis

C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform - NO LONGER MAINTAINED - Please check https://github.com/cpp-redis/cpp_redis
MIT License
1.25k stars 553 forks source link

make examples error #194

Open Lomect opened 6 years ago

Lomect commented 6 years ago

when i make example some error like this :

$make
Scanning dependencies of target cpp_redis_high_availability_client
[  8%] Building CXX object CMakeFiles/cpp_redis_high_availability_client.dir/cpp_redis_high_availability_client.o
[ 16%] Linking CXX executable cpp_redis_high_availability_client
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(redis_connection.cpp.o): in the function 'cpp_redis::network:: Redis_connection::redis_connection()':
Redis_connection.cpp:(.text+0x1b24): Undefined reference to ‘tacopie::tcp_client::tcp_client()’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(redis_connection.cpp.o): in the function 'cpp_redis::network:: Tcp_client::~tcp_client()':
Redis_connection.cpp:(.text._ZN9cpp_redis7network10tcp_clientD2Ev[_ZN9cpp_redis7network10tcp_clientD5Ev]+0x14): Undefined reference to ‘tacopie::tcp_client::~tcp_client()’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(redis_connection.cpp.o): in the function 'std::_Sp_counted_ptr_inplace<cpp_redis ::network::tcp_client, std::allocator<cpp_redis::network::tcp_client>, (__gnu_cxx::_Lock_policy)2>::_M_dispose()'
redis_connection.cpp :( text._ZNSt23_Sp_counted_ptr_inplaceIN9cpp_redis7network10tcp_clientESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv [_ZNSt23_Sp_counted_ptr_inplaceIN9cpp_redis7network10tcp_clientESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE10_M_disposeEv] + 0x28):. of 'tacopie :: tcp_client :: ~ tcp_client ()' undefined reference
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(redis_connection.cpp.o): in the function 'cpp_redis::network:: Tcp_client::~tcp_client()':
Redis_connection.cpp:(.text._ZN9cpp_redis7network10tcp_clientD0Ev[_ZN9cpp_redis7network10tcp_clientD5Ev]+0x18): Undefined reference to ‘tacopie::tcp_client::~tcp_client()’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::async_write(cpp_redis::network::tcp_client_iface::write_request&)'
Tcp_client.cpp: (.text+0x3f0): Undefined reference to ‘tacopie::tcp_client::async_write(tacopie::tcp_client::write_request const&)’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::async_read(cpp_redis::network::tcp_client_iface::read_request&)'
Tcp_client.cpp: (.text+0x604): Undefined reference to ‘tacopie::tcp_client::async_read(tacopie::tcp_client::read_request const&)’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::set_nb_workers(unsigned long)'
Tcp_client.cpp: (.text+0x6f9): Undefined reference to 'tacopie::tcp_client::get_io_service() const'
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Set_default_nb_workers(unsigned long)':
Tcp_client.cpp: (.text+0x715): Undefined reference to ‘tacopie::get_default_io_service()’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
Tcp_client.cpp:(.text+0x35): for 'tacopie::tcp_client::connect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned Int, unsigned int) 'undefined reference
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::disconnect(bool)' in:
Tcp_client.cpp: (.text+0x49): Undefined reference to ‘tacopie::tcp_client::disconnect(bool)’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::is_connected() const':
Tcp_client.cpp: (.text+0x55): undefined reference to ‘tacopie::tcp_client::is_connected() const’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::set_on_disconnection_handler(std::function<void ()> const&)'
Tcp_client.cpp: (.text+0xf5): undefined reference to ‘tacopie::tcp_client::set_on_disconnection_handler(std::function<void ()> const&)’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Tcp_client::set_nb_workers(unsigned long)'
Tcp_client.cpp: (.text+0x705): Undefined reference to ‘tacopie::io_service::set_nb_workers(unsigned long)’
/usr/local/lib/gcc/x86_64-pc-linux-gnu/6.2.0/../../../libcpp_redis.a(tcp_client.cpp.o): in the function 'cpp_redis::network:: Set_default_nb_workers(unsigned long)':
Tcp_client.cpp: (.text+0x721): undefined reference to ‘tacopie::io_service::set_nb_workers(unsigned long)’
Collect2: Error: ld returns 1
CMakeFiles/cpp_redis_high_availability_client.dir/build.make:83: recipe for target 'cpp_redis_high_availability_client' failed
make[2]: *** [cpp_redis_high_availability_client] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/cpp_redis_high_availability_client.dir/all' failed
make[1]: *** [CMakeFiles/cpp_redis_high_availability_client.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
cjgordon commented 6 years ago

Please try make examples using following commands:

mkdir build
cd build
cmake .. -DBUILD_EXAMPLES=true
make