ZanRedisDB icon indicating copy to clipboard operation
ZanRedisDB copied to clipboard

ZanRedisDB make failed:undefined reference to `ZSTD_versionNumber'

Open hhofchina opened this issue 5 years ago • 3 comments

github.com/youzan/gorocksdb

/root/soft/rocksdb/librocksdb.a(db_impl.o): In function rocksdb::DBImpl::DBImpl(rocksdb::DBOptions const&, std::string const&, bool, bool)': /root/soft/rocksdb/./util/compression.h:275: undefined reference to ZSTD_versionNumber'

hhofchina avatar Feb 10 '20 01:02 hhofchina

rocksdb的zstd压缩开启了的话, 可以使用下面两种方式解决

添加CGO_LDFLAGS参数, 例如 CGO_LDFLAGS="-L/usr/local/lib -lrocksdb -lzstd" ,这样要求其他部署机器上也要安装 zstd 库

或者编译rocksdb时, 使用ROCKSDB_DISABLE_ZSTD禁用zstd

absolute8511 avatar Feb 11 '20 01:02 absolute8511

/root/soft/rocksdb/./util/compression.h:844: undefined reference to LZ4_createStreamDecode' /root/soft/rocksdb/librocksdb.a(format.o): In function rocksdb::UncompressBlockContentsForCompressionType(rocksdb::UncompressionContext const&, char const*, unsigned long, rocksdb::BlockContents*, unsigned int, rocksdb::ImmutableCFOptions const&, rocksdb::MemoryAllocator*)': format.cc:(.text+0x103e): undefined reference to LZ4_setStreamDecode' format.cc:(.text+0x1065): undefined reference to LZ4_decompress_safe_continue' format.cc:(.text+0x1074): undefined reference to LZ4_freeStreamDecode' format.cc:(.text+0x127e): undefined reference to LZ4_createStreamDecode' format.cc:(.text+0x129e): undefined reference to LZ4_setStreamDecode' format.cc:(.text+0x12c5): undefined reference to LZ4_decompress_safe_continue' format.cc:(.text+0x12d4): undefined reference to `LZ4_freeStreamDecode'

需要继续禁用LZ4?

hhofchina avatar Feb 19 '20 02:02 hhofchina

是的, 类似处理

absolute8511 avatar Feb 19 '20 08:02 absolute8511