libbf icon indicating copy to clipboard operation
libbf copied to clipboard

how to install the code in os x?

Open shuyaoyimei opened this issue 6 years ago • 5 comments

hello i have install it in /usr/local/include, but i can not find the bf.h, i am sure the include path is correct, could you give me some help. thanks!

shuyaoyimei avatar Apr 27 '18 07:04 shuyaoyimei

Try including bf/bf.h. The installation creates an extra directory.

mavam avatar Apr 27 '18 07:04 mavam

thanks,mavam i have try it, but it do not work. i also try command "find / -name bf.h" and get nothing. could you share more detail in the install progress?

shuyaoyimei avatar Apr 27 '18 13:04 shuyaoyimei

My bad, try including bf/all.hpp, that's the default include for the entire library.

mavam avatar Apr 27 '18 19:04 mavam

hello,amvam i get the error when i execute clang++ -std=c++11 -o out/TestBf testbf.cpp -v

Apple LLVM version 9.1.0 (clang-902.0.39.1) Target: x86_64-apple-darwin17.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin "/Library/Developer/CommandLineTools/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name testbf.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 351.8 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Library/Developer/CommandLineTools/usr/lib/clang/9.1.0 -stdlib=libc++ -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/nino/Downloads/RTree-master -ferror-limit 19 -fmessage-length 204 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.13.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/51/gf7zs5q55kx8015hspd22hc40000gn/T/testbf-98f318.o -x c++ testbf.cpp clang -cc1 version 9.1.0 (clang-902.0.39.1) default target x86_64-apple-darwin17.5.0 ignoring nonexistent directory "/usr/include/c++/v1" #include "..." search starts here: #include <...> search starts here: /Library/Developer/CommandLineTools/usr/include/c++/v1 /usr/local/include /Library/Developer/CommandLineTools/usr/lib/clang/9.1.0/include /Library/Developer/CommandLineTools/usr/include /usr/include /System/Library/Frameworks (framework directory) /Library/Frameworks (framework directory) End of search list. "/Library/Developer/CommandLineTools/usr/bin/ld" -demangle -lto_library /Library/Developer/CommandLineTools/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o out/TestBf /var/folders/51/gf7zs5q55kx8015hspd22hc40000gn/T/testbf-98f318.o -lc++ -lSystem /Library/Developer/CommandLineTools/usr/lib/clang/9.1.0/lib/darwin/libclang_rt.osx.a Undefined symbols for architecture x86_64: "bf::basic_bloom_filter::clear()", referenced from: _main in testbf-98f318.o "bf::basic_bloom_filter::basic_bloom_filter(double, unsigned long, unsigned long, bool, bool)", referenced from: _main in testbf-98f318.o "vtable for bf::basic_bloom_filter", referenced from: bf::basic_bloom_filter::~basic_bloom_filter() in testbf-98f318.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

my os is os x 10.13.4, i have google the error and i try the all possible methods but not work.

i am so sorry to bother you, thanks.

shuyaoyimei avatar Apr 28 '18 03:04 shuyaoyimei

Looks like linking fails because -lbf is missing on the command line. If adding -lbf doesn't do the trick, try adding -L/path/to/libbf-shared-lib.

mavam avatar Apr 30 '18 12:04 mavam