我正在努力建造
https://github.com/google/leveldb
支持
https://github.com/google/snappy
在mac os x high sierra上进行压缩,以便以后在XCode项目中使用,我正在浏览自述文件中描述的两个项目的标准编译过程。这包括通过
cmake
对于这两个项目。如果
snappy
项目流程顺畅,所有构建和安装都完美无缺。但是,如果
leveldb
,我做不到
cmake公司
发现
精炼的
我以前通过安装的库
make install
。我不知道如何调试
cmake公司
并找到它寻找图书馆的地方。
非常感谢您的帮助。
以下是两个构建的结果:
编辑
这是一个输出,似乎列表中有/usr/local/lib
另一个编辑
我试过跑步
cc -DCHECK_FUNCTION_EXISTS=snappy_compress -Wl,-search_paths_first -Wl,-headerpad_max_install_names -o check_snappy_exist CheckFunctionExists.c -lsnappy
根据提供的解决方案
sel-fish
。但如果出现以下输出失败:
Undefined symbols for architecture x86_64:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"std::logic_error::logic_error(char const*)", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"std::length_error::~length_error()", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
snappy::Uncompress(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libsnappy.a(snappy.cc.o)
snappy::Compress(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libsnappy.a(snappy.cc.o)
"std::terminate()", referenced from:
___clang_call_terminate in libsnappy.a(snappy.cc.o)
"typeinfo for std::length_error", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for snappy::Sink in libsnappy.a(snappy-sinksource.cc.o)
typeinfo for snappy::Source in libsnappy.a(snappy-sinksource.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for __cxxabiv1::__si_class_type_info", referenced from:
typeinfo for snappy::ByteArraySource in libsnappy.a(snappy-sinksource.cc.o)
typeinfo for snappy::UncheckedByteArraySink in libsnappy.a(snappy-sinksource.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::length_error", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"operator delete[](void*)", referenced from:
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::SnappySinkAllocator::Deleter(void*, char const*, unsigned long) in libsnappy.a(snappy.cc.o)
"operator delete(void*)", referenced from:
snappy::UncompressAsMuchAsPossible(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::Uncompress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
snappy::ByteArraySource::~ByteArraySource() in libsnappy.a(snappy-sinksource.cc.o)
snappy::UncheckedByteArraySink::~UncheckedByteArraySink() in libsnappy.a(snappy-sinksource.cc.o)
"operator new[](unsigned long)", referenced from:
snappy::internal::WorkingMemory::GetHashTable(unsigned long, int*) in libsnappy.a(snappy.cc.o)
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::SnappyScatteredWriter<snappy::SnappySinkAllocator>::SlowAppend(char const*, unsigned long) in libsnappy.a(snappy.cc.o)
"operator new(unsigned long)", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"___cxa_allocate_exception", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"___cxa_begin_catch", referenced from:
___clang_call_terminate in libsnappy.a(snappy.cc.o)
"___cxa_free_exception", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"___cxa_pure_virtual", referenced from:
vtable for snappy::Sink in libsnappy.a(snappy-sinksource.cc.o)
vtable for snappy::Source in libsnappy.a(snappy-sinksource.cc.o)
"___cxa_throw", referenced from:
void std::__1::vector<snappy::SnappySinkAllocator::Datablock, std::__1::allocator<snappy::SnappySinkAllocator::Datablock> >::__push_back_slow_path<snappy::SnappySinkAllocator::Datablock const>(snappy::SnappySinkAllocator::Datablock const&) in libsnappy.a(snappy.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libsnappy.a(snappy.cc.o)
"___gxx_personality_v0", referenced from:
snappy::GetUncompressedLength(snappy::Source*, unsigned int*) in libsnappy.a(snappy.cc.o)
snappy::Compress(snappy::Source*, snappy::Sink*) in libsnappy.a(snappy.cc.o)
snappy::RawUncompressToIOVec(char const*, unsigned long, iovec const*, unsigned long) in libsnappy.a(snappy.cc.o)
snappy::RawUncompressToIOVec(snappy::Source*, iovec const*, unsigned long) in libsnappy.a(snappy.cc.o)
snappy::RawUncompress(char const*, unsigned long, char*) in libsnappy.a(snappy.cc.o)
snappy::RawUncompress(snappy::Source*, char*) in libsnappy.a(snappy.cc.o)
snappy::Uncompress(char const*, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libsnappy.a(snappy.cc.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)