liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

snappy #234

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.i write a c++ program.
2.in linux ,g++ -o sa Main.cpp libleveldb.a -lpthread

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
leveldb 1.14.0, red hat

Please provide any additional information below.
this is problem:
libleveldb.a(table_builder.o): In function 
`leveldb::TableBuilder::WriteBlock(leveldb::BlockBuilder*, 
leveldb::BlockHandle*)':
table_builder.cc:(.text+0x6a8): undefined reference to 
`snappy::MaxCompressedLength(unsigned long)'
table_builder.cc:(.text+0x6e2): undefined reference to 
`snappy::RawCompress(char const*, unsigned long, char*, unsigned long*)'
libleveldb.a(format.o): In function 
`leveldb::ReadBlock(leveldb::RandomAccessFile*, leveldb::ReadOptions const&, 
leveldb::BlockHandle const&, leveldb::BlockContents*)':
format.cc:(.text+0x5de): undefined reference to 
`snappy::GetUncompressedLength(char const*, unsigned long, unsigned long*)'
format.cc:(.text+0x64e): undefined reference to `snappy::RawUncompress(char 
const*, unsigned long, char*)'
collect2: ld returned 1 exit status

i think may be snappy problem,but i dont kown what to do

Original issue reported on code.google.com by wyy...@gmail.com on 7 May 2014 at 1:32

GoogleCodeExporter commented 9 years ago
I solved this problem.
Add "-lsnappy" when you build your c++ program.
If you don't have snappy library, build snappy.

Original comment by tksh...@gmail.com on 11 Feb 2015 at 6:09