I have tried to compile the code shown here:
But I got a linking error.
I tried the solution mention here.
But again, I got this error:
gcc main.c -I /usr/include/monetdb -lmapi
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference toSHA224_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: undefined reference tosocket_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: undefined reference toSHA384_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: undefined reference toRIPEMD160_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: undefined reference toRIPEMD160_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: undefined reference toSHA224_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: undefined reference toSHA512_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: undefined reference toblock_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: undefined reference toSHA384_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: undefined reference tomnstr_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: undefined reference toSHA256_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: undefined reference toSHA1_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: undefined reference tomnstr_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: undefined reference toSHA256_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: undefined reference tomnstr_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: undefined reference tosocket_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: undefined reference toRIPEMD160_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: undefined reference toMD5_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: undefined reference toopen_wastream'
SHA512_Init'
/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/libmapi.so: undefined reference to
collect2: error: ld returned 1 exit status
When I tried the solution mention here:
pkg-config --libs monetdb-mapi and pkg-config --cflags monetdb-mapi
I got this error:
The package
bzip2
was not found in thepkg-config
search path.
Perhaps you should add the directory containing `bzip2.pc' to the PKG_CONFIG_PATH environment variable.
Package 'bzip2', required by 'monetdb-stream', not found
which, after a search, I found, that Debian doesn't have a bzip2.pc
.
I have installed the following libraries:
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
So any help would be appreciated.
My Ubuntu version is 18.04
-lssl
, and possibly-lcrypto
) look at what is not found, e.g. "undefined reference toSHA224_Update
". See SHA224_Update – David C. Rankin