我试图编译here所示的代码:
但是我出现了链接错误。
我尝试了解决方案提及here。
但是,再次出现此错误:
gcc main.c -I / usr / include / monetdb -lmapi
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对SHA224_Update'
mnstr_settimeout的引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对socket_rastream'
mnstr_destroy的未定义引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对SHA384_Init'
MD5_Final'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对RIPEMD160_Init'
mnstr_errnr的未定义引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对RIPEMD160_Update'
SHA384_Update的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对SHA224_Init'
SHA256_Init的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对SHA512_Update'
mnstr_init'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对block_stream'
mnstr_write'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对SHA384_Final'
SHA1_Update的引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对mnstr_error'
SHA512_Final'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对SHA256_Final'
mnstr_flush的引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对SHA1_Init'
SHA224_Final'的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对mnstr_read_block'
mnstr_printf'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对SHA256_Update'
isa_block_stream'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对mnstr_set_byteorder'
mnstr_read'的未定义引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对socket_wastream'
MD5_Init的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:对RIPEMD160_Final'
close_stream'的未定义引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对MD5_Update'
SHA1_Final'的引用
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so:未定义对open_wastream'
SHA512_Init的引用'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
collect2:错误:ld返回1退出状态
当我尝试解决方案时,请提及here:
pkg-config --libs monetdb-mapi and pkg-config --cflags monetdb-mapi
我收到此错误:
在
bzip2
搜索路径中找不到包pkg-config
。
也许您应该将包含“ bzip2.pc”的目录添加到PKG_CONFIG_PATH环境变量中。
找不到'monetdb-stream'所需的软件包'bzip2'
在搜索后,我发现Debian没有bzip2.pc
。
我已经安装了以下库:
sudo apt-get install libmonetdb-client-dev
sudo apt-get install libmonetdb-stream-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install liblzma-dev
因此,我们将不胜感激。
我的Ubuntu版本是18.04
答案 0 :(得分:0)
感谢@David C. Rankin提到的链接问题消失了: 这是完整的命令:
gcc main.c -I / usr / include / monetdb -lmapi -lssl -lcrypto -lstream -lcurl -llzma -lbz2