baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.99k stars 886 forks source link

Compile Error #297

Closed Yuan-Zhuo closed 3 years ago

Yuan-Zhuo commented 3 years ago

It seems from levedb and snappy.

[ 91%] Built target OBJ_LIB
[ 93%] Built target braft-shared
[ 95%] Built target braft-static
[ 97%] Linking CXX executable ../output/bin/braft_cli
/usr/local/lib/libleveldb.a(table_builder.cc.o): In function `leveldb::TableBuilder::WriteBlock(leveldb::BlockBuilder*, leveldb::BlockHandle*)':
table_builder.cc:(.text+0x659): undefined reference to `snappy::MaxCompressedLength(unsigned long)'
table_builder.cc:(.text+0x686): undefined reference to `snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
/usr/local/lib/libleveldb.a(format.cc.o): In function `leveldb::ReadBlock(leveldb::RandomAccessFile*, leveldb::ReadOptions const&, leveldb::BlockHandle const&, leveldb::BlockContents*)':
format.cc:(.text+0x3b6): undefined reference to `snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*)'
format.cc:(.text+0x3da): undefined reference to `snappy::RawUncompress(char const*, unsigned long, char*)'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/braft_cli.dir/build.make:102: recipe for target 'output/bin/braft_cli' failed
make[2]: *** [output/bin/braft_cli] Error 1
CMakeFiles/Makefile2:218: recipe for target 'tools/CMakeFiles/braft_cli.dir/all' failed
make[1]: *** [tools/CMakeFiles/braft_cli.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
Yuan-Zhuo commented 3 years ago

Solved