Hi there,
I’ve built libcouchbase (2.10.4) locally with -enable-static
which has produced libcouchbase.a
however when linking in my application (just a simple app open connection and perform a retrieval) I get a number of errors…
Cmake references:
include_directories(/usr/local/include /usr/local/include/libcouchbase)
target_link_libraries(main PRIVATE /usr/local/lib/libcouchbase.a)
errors:
[100%] Linking CXX executable main
/usr/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1
g++ CMakeFiles/main.dir/main.cpp.o -o main /usr/lib/x86_64-linux-gnu/libboost_thread.a /usr/local/lib/libcouchbase.a /usr/lib/x86_64-linux-gnu/libboost_chrono.a /usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_date_time.a /usr/lib/x86_64-linux-gnu/libboost_atomic.a -lpthread
/usr/local/lib/libcouchbase.a(dns-srv.cc.o): In function `lcb::dnssrv_query(char const*, lcb::Hostlist&)':
/couchbase/libcouchbase/src/dns-srv.cc:33: undefined reference to `__res_search'
/couchbase/libcouchbase/src/dns-srv.cc:38: undefined reference to `ns_initparse'
/couchbase/libcouchbase/src/dns-srv.cc:43: undefined reference to `ns_msg_getflag'
/couchbase/libcouchbase/src/dns-srv.cc:58: undefined reference to `ns_parserr'
/couchbase/libcouchbase/src/dns-srv.cc:75: undefined reference to `ns_get16'
/couchbase/libcouchbase/src/dns-srv.cc:76: undefined reference to `ns_get16'
/couchbase/libcouchbase/src/dns-srv.cc:77: undefined reference to `ns_get16'
/couchbase/libcouchbase/src/dns-srv.cc:82: undefined reference to `ns_name_uncompress'
/usr/local/lib/libcouchbase.a(iofactory.c.o): In function `get_create_func':
/couchbase/libcouchbase/src/iofactory.c:208: undefined reference to `dlopen'
/couchbase/libcouchbase/src/iofactory.c:220: undefined reference to `dlsym'
/couchbase/libcouchbase/src/iofactory.c:211: undefined reference to `dlerror'
/couchbase/libcouchbase/src/iofactory.c:224: undefined reference to `dlerror'
/couchbase/libcouchbase/src/iofactory.c:228: undefined reference to `dlclose'
/usr/local/lib/libcouchbase.a(iofactory.c.o): In function `close_dlhandle':
/couchbase/libcouchbase/src/iofactory.c:240: undefined reference to `dlclose'
/couchbase/libcouchbase/src/iofactory.c:240: undefined reference to `dlclose'
Are there other options required or is this an issue with the static build of libcouchbase?