Hi,Kenton:
I like capnp, I use Capn ,Link with static libraries( use .a) Failed ,Error Like this
ERROR: xxxxx/BUILD:6:1: Linking of rule '//:test_capn' failed (Exit 1)
capnp/lib/libcapnpc.a(schema-parser.o):schema-parser.c++:function capnp::ParsedSchema::findNested(kj::StringPtr) const: error: undefined reference to 'capnp::SchemaLoader::get(unsigned long, capnp::schema::Brand::Reader, capnp::Schema) const'
but the libcapnpc.a has the “SchemaLoader::get” Symbol like this:
nm capnp/lib/libcapnpc.a |grep SchemaLoader|grep get
nm -C lib/libcapnpc.a |grep SchemaLoader|grep get
U capnp::SchemaLoader::get(unsigned long, capnp::schema::Brand::Reader, capnp::Schema) const
U capnp::SchemaLoader::getType(capnp::schema::Type::Reader, capnp::Schema) const
U capnp::SchemaLoader::get(unsigned long, capnp::schema::Brand::Reader, capnp::Schema) const
capnp/lib$ ll -rth
总用量 8.4M
-rw-r--r-- 1 mulou mulou 1.1M 9月 27 15:08 libcapnp.a
-rw-r--r-- 1 mulou mulou 1.4M 9月 27 15:08 libcapnpc.a
-rw-r--r-- 1 mulou mulou 330K 9月 27 15:08 libcapnp-json.a
-rw-r--r-- 1 mulou mulou 2.0M 9月 27 15:08 libcapnp-rpc.a
-rw-r--r-- 1 mulou mulou 941K 9月 27 15:08 libkj.a
-rw-r--r-- 1 mulou mulou 1.2M 9月 27 15:08 libkj-async.a
-rw-r--r-- 1 mulou mulou 70K 9月 27 15:08 libkj-test.a
-rw-r--r-- 1 mulou mulou 1.5M 9月 27 15:08 libkj-http.a
I try to link it with dynamic libraries,it works
nm -C lib-old/libcapnpc.so |grep SchemaLoader|grep get
U capnp::SchemaLoader::get(unsigned long, capnp::schema::Brand::Reader, capnp::Schema) const
U capnp::SchemaLoader::getType(capnp::schema::Type::Reader, capnp::Schema) const
But I want to use static libraries instead of dynamic libraries because dynamic libraries are a little cumbersome to deploy.
I install the capn libraries like this :
All the best
whutbd