Am 11.04.19 um 22:49 schrieb Jan Girlich:
Am 11.04.19 um 22:47 schrieb Neal H. Walfield:
At Thu, 11 Apr 2019 22:39:53 +0200, Jan Girlich wrote:
make -Copenpgp-ffi examples make[1]: Entering directory '/home/jan/Projekte/sequoia/openpgp-ffi' make -Cexamples make[2]: Entering directory '/home/jan/Projekte/sequoia/openpgp-ffi/examples' mkdir -p /home/jan/Projekte/sequoia/target/debug/c-examples/openpgp-ffi cc -I../include -O0 -g -Wall -Werror -L/home/jan/Projekte/sequoia/target/debug -lsequoia_openpgp_ffi -o "/home/jan/Projekte/sequoia/target/debug/c-examples/openpgp-ffi/example" "example.c" /tmp/cck9xmO7.o: In function `main': /home/jan/Projekte/sequoia/openpgp-ffi/examples/example.c:37: undefined reference to `pgp_tpk_from_bytes' /home/jan/Projekte/sequoia/openpgp-ffi/examples/example.c:39: undefined reference to `pgp_error_to_string' /home/jan/Projekte/sequoia/openpgp-ffi/examples/example.c:41: undefined reference to `pgp_tpk_debug' /home/jan/Projekte/sequoia/openpgp-ffi/examples/example.c:45: undefined reference to `pgp_tpk_free' collect2: error: ld returned 1 exit status Makefile:29: recipe for target '/home/jan/Projekte/sequoia/target/debug/c-examples/openpgp-ffi/example' failed
Can you please confirm that /home/jan/Projekte/sequoia/target/debug contains libsequoia_openpgp_ffi.so.
Yes, it does:
% ls /home/jan/Projekte/sequoia/target/debug/libsequoia_openpgp_ffi.so /home/jan/Projekte/sequoia/target/debug/libsequoia_openpgp_ffi.so*
hm, this is really ineresting. I confirmed it's the following compiler call, that's failing:
cc -I../include -O0 -g -Wall -Werror -L/home/jan/Projekte/sequoia/target/debug -lsequoia_openpgp_ffi -o "/home/jan/Projekte/sequoia/target/debug/c-examples/openpgp-ffi/example" "example.c"
I can confirm that it finds the included openpgp.h file in ../includes. The -L path is correct and the libsequoia_openpgp_ffi.so is found as well.
The lib is also compiled with C and exports the requested symbol:
% nm -D --defined-only ../../target/debug/libsequoia_openpgp_ffi.so | grep "pgp_tpk_from_bytes" 0000000000106430 T pgp_tpk_from_bytes
(No mangled function names here)
I don't understand why it's saying the reference would be undefined.
Any other idea what to check?
Cheers, Jan