ZanRedisDB
ZanRedisDB copied to clipboard
ZanRedisDB make failed:undefined reference to `ZSTD_versionNumber'
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'
rocksdb的zstd压缩开启了的话, 可以使用下面两种方式解决
添加CGO_LDFLAGS参数, 例如 CGO_LDFLAGS="-L/usr/local/lib -lrocksdb -lzstd" ,这样要求其他部署机器上也要安装 zstd 库
或者编译rocksdb时, 使用ROCKSDB_DISABLE_ZSTD禁用zstd
/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?
是的, 类似处理