MonetDB客户端编译

我是数据库社区的初学者。 我一直在尝试使用C / C ++ MAPI与MonetDB进行交互。 我已经在我的Ubuntu 14.04 LTS机器上安装了MonetDB,当我尝试从这里编译示例程序时,我收到以下错误:

$ gcc test.c -I /usr/include/monetdb -lmapi 

test.c :(。text + 0x29):对mapi_explain_query' test.c:(.text+0x35): undefined reference to mapi_result_error’test.c :(。text + 0x50)的未定义引用:对mapi_explain_result' test.c:(.text+0x5c): undefined reference to未定义引用mapi_explain_result' test.c:(.text+0x5c): undefined reference to mapi_next_result’test.c :(。text + 0x6d)的未定义引用:对mapi_close_handle' test.c:(.text+0x79): undefined reference to mapi_destroy’test.c的mapi_close_handle' test.c:(.text+0x79): undefined reference to : (.text + 0x98):对mapi_explain' test.c:(.text+0xa4): undefined reference to mapi_destroy’/tmp/cctyQopc.o的mapi_explain' test.c:(.text+0xa4): undefined reference to :在函数query': test.c:(.text+0xf9): undefined reference to mapi_query’test.c :(。text + 0x110)的未定义引用:对mapi_error' /tmp/cctyQopc.o: In function未定义引用mapi_error' /tmp/cctyQopc.o: In function更新’:test.c :(。text + 0x160):对mapi_close_handle' /tmp/cctyQopc.o: In function未定义引用mapi_close_handle' /tmp/cctyQopc.o: In function main’:test.c :(。text + 0x1b6):未定义引用mapi_connect' test.c:(.text+0x1c6): undefined reference to mapi_error’test.c :(。 text + 0x238):对mapi_fetch_field' test.c:(.text+0x24d): undefined reference to mapi_fetch_field' test.c:(.text+0x24d): undefined reference to mapi_fetch_field’test.c :(。text + 0x277):未定义引用mapi_fetch_row' test.c:(.text+0x287): undefined reference to mapi_close_handle’test.c :(。text + 0x293):未定义引用` mapi_destroy’cols2:错误:ld返回1退出状态

这个问题之前已经在这里被问过 ,答案没有解决问题(尽管答案被接受了,但我不确定为什么)。 任何帮助/指示都会很棒!

在Ubuntu 18.04上使用:

pkg-config –libs monetdb-mapi和pkg-config –cflags monetdb-mapi

因为Ubuntu没有bzip2.pc而无法工作:

它是如何工作的:

gcc main.c -I / usr / include / monetdb -lmapi -lssl -lcrypto -lstream -lcurl -llzma -lbz2