MonetDB客户端编译 [英] MonetDB client compilation
问题描述
我是数据库社区的初学者。我一直在尝试使用C / C ++ MAPI 与MonetDB进行交互。我已经在Ubuntu 14.04 LTS计算机上安装了MonetDB,并且当我尝试从在这里,出现以下错误:
I'm a beginner in the Database community. I have been trying to interface with MonetDB using C/C++ MAPI. I have installed MonetDB on my Ubuntu 14.04 LTS machine and when I try to compile a sample program from here, I get the following error:
$ gcc test.c -I /usr/include/monetdb -lmapi
test.c :(。text + 0x29):未定义引用
mapi_explain_query'
mapi_result_error'
test.c :(。text + 0x35):未定义引用
test.c :(。text + 0x50):未定义对mapi_explain_result'
mapi_next_result'
test.c :(。text + 0x5c):未定义对
test.c :( .text + 0x6d):未定义引用mapi_close_handle'
mapi_destroy'
test.c :(。text + 0x79):未定义引用
测试。 c :(。text + 0x98):未定义引用mapi_explain'
mapi_destroy'
test.c :(。text + 0xa4):未定义引用
/tmp/cctyQopc.o:在函数中nquery':
mapi_query'
test.c :(。text + 0xf9):未定义引用
test.c :(。text + 0x110 ):对mapi_error'
update':
/tmp/cctyQopc.o的未定义引用:在函数中
test.c :(。text + 0x160) :对mapi_close_handle'的未定义引用'
main':
/tmp/cctyQopc.o:在函数中
test.c :(。text + 0x1b6):未定义引用mapi_connect'
mapi_error'
test.c :(。text + 0x1c6):未定义引用
test.c :(。text + 0x238):未定义引用mapi_fetch_field'
mapi_fetch_field'
test.c :(。text + 0x24d):未定义引用
test.c :( .text + 0x277):未定义引用mapi_fetch_row'
mapi_close_handle'
test.c :(。text + 0x287):未定义引用
测试。 c :(。text + 0x293):对`mapi_destroy'
collect2的未定义引用:错误:ld返回了1个退出状态
test.c:(.text+0x29): undefined reference to
mapi_explain_query' test.c:(.text+0x35): undefined reference to
mapi_result_error' test.c:(.text+0x50): undefined reference tomapi_explain_result' test.c:(.text+0x5c): undefined reference to
mapi_next_result' test.c:(.text+0x6d): undefined reference tomapi_close_handle' test.c:(.text+0x79): undefined reference to
mapi_destroy' test.c:(.text+0x98): undefined reference tomapi_explain' test.c:(.text+0xa4): undefined reference to
mapi_destroy' /tmp/cctyQopc.o: In functionquery': test.c:(.text+0xf9): undefined reference to
mapi_query' test.c:(.text+0x110): undefined reference tomapi_error' /tmp/cctyQopc.o: In function
update': test.c:(.text+0x160): undefined reference tomapi_close_handle' /tmp/cctyQopc.o: In function
main': test.c:(.text+0x1b6): undefined reference tomapi_connect' test.c:(.text+0x1c6): undefined reference to
mapi_error' test.c:(.text+0x238): undefined reference tomapi_fetch_field' test.c:(.text+0x24d): undefined reference to
mapi_fetch_field' test.c:(.text+0x277): undefined reference tomapi_fetch_row' test.c:(.text+0x287): undefined reference to
mapi_close_handle' test.c:(.text+0x293): undefined reference to `mapi_destroy' collect2: error: ld returned 1 exit status
此问题先前已被问过此处,答案并不能解决问题(尽管答案已被接受,但我不确定为什么)。任何帮助/指导都将非常有用!
This question has previously been asked here and the answer did not solve the problem (although the answer was accepted, I'm not sure why). Any help/directions would be great!
推荐答案
在Ubuntu 18.04上,使用:
On Ubuntu 18.04 using:
pkg-config --libs monetdb-mapi和pkg-config --cflags monetdb-mapi
pkg-config --libs monetdb-mapi and pkg-config --cflags monetdb-mapi
不起作用,因为Ubuntu没有bzip2。 pc:
Won't work because Ubuntu doesn't have a bzip2.pc:
这里是如何工作的:
gcc main.c -I / usr / include / monetdb- lmapi -lssl -lcrypto -lstream -lcurl -llzma -lbz2
gcc main.c -I /usr/include/monetdb -lmapi -lssl -lcrypto -lstream -lcurl -llzma -lbz2
这篇关于MonetDB客户端编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!