Cassandra c++ driver "undefined reference" error - c++

So I followed the Ubuntu instructions on the Datastax website to build the c++ driver (http://datastax.github.io/cpp-driver/topics/building/).
sudo apt-add-repository ppa:linuxjedi/ppa
sudo apt-get update
sudo apt-get install g++ make cmake libuv-dev libssl-dev
git clone https://github.com/datastax/cpp-driver.git
mkdir cpp-driver/build
cd cpp-driver/build
cmake ..
make
When I try to compile using g++ I get the following error messages:
test.cpp:(.text+0x11): undefined reference to cass_cluster_new'
test.cpp:(.text+0x1a): undefined reference tocass_session_new'
test.cpp:(.text+0x2f): undefined reference to cass_cluster_set_contact_points'
test.cpp:(.text+0x42): undefined reference tocass_session_connect'
test.cpp:(.text+0x52): undefined reference to cass_future_error_code'
test.cpp:(.text+0x76): undefined reference tocass_statement_new'
test.cpp:(.text+0x8d): undefined reference to cass_session_execute'
test.cpp:(.text+0x9d): undefined reference tocass_future_error_code'
test.cpp:(.text+0xb6): undefined reference to cass_future_get_result'
test.cpp:(.text+0xc6): undefined reference tocass_iterator_from_result'
test.cpp:(.text+0xd8): undefined reference to cass_iterator_get_row'
test.cpp:(.text+0xed): undefined reference tocass_row_get_column_by_name'
test.cpp:(.text+0x108): undefined reference to cass_value_get_string'
test.cpp:(.text+0x12d): undefined reference tocass_iterator_next'
test.cpp:(.text+0x142): undefined reference to cass_result_free'
test.cpp:(.text+0x14e): undefined reference tocass_iterator_free'
test.cpp:(.text+0x167): undefined reference to cass_future_error_message'
test.cpp:(.text+0x196): undefined reference tocass_statement_free'
test.cpp:(.text+0x1a2): undefined reference to cass_future_free'
test.cpp:(.text+0x1ae): undefined reference tocass_session_close'
test.cpp:(.text+0x1be): undefined reference to cass_future_wait'
test.cpp:(.text+0x1ca): undefined reference tocass_future_free'
test.cpp:(.text+0x1e3): undefined reference to cass_future_error_message'
test.cpp:(.text+0x212): undefined reference tocass_future_free'
test.cpp:(.text+0x21e): undefined reference to cass_cluster_free'
test.cpp:(.text+0x22a): undefined reference tocass_session_free'
collect2: error: ld returned 1 exit status
What am I missing when trying to compile: g++ test.cpp
Thank you.

You need to actually link to the previously build cassandra driver.
g++ test.cpp -Lcpp-build/build -lcassandra
-L tells g++ where it searches for libraries
-l links the library

Related

Can't link C++ project with openssl static libraries

I have some project done on C++ and I need to compile it for Windows XP and later.
This is the header file of my RsaEncryptor class (I think it is no matter to post sources here, because I'm sure on 100% that it works fine, but if it is required I can do it):
#ifndef RSAENCRYPTOR_H_
#define RSAENCRYPTOR_H_
#include <stdexcept>
#include <openssl/rsa.h>
#include <openssl/engine.h>
#include <openssl/pem.h>
// One of this paddings can be used
//#define PADDING RSA_PKCS1_OAEP_PADDING
#define PADDING RSA_PKCS1_PADDING
//#define PADDING RSA_NO_PADDING
class RsaEncryptor {
private:
RSA* publicKey;
RSA* privateKey;
public:
RsaEncryptor() {
publicKey = nullptr;
privateKey = nullptr;
}
~RsaEncryptor() {
if ( this->publicKey )
RSA_free( this->publicKey );
if ( this->privateKey )
RSA_free( this->privateKey );
}
size_t GetCipherBytesCount() {
return 172; //is default for 1024 bit key length
}
void SetPublicKeyFromString(const std::string& content);
void SetPrivateKeyFromString(const std::string& content);
std::string Encrypt(const std::string& plainData);
std::string Decrypt(const std::string& cipherData);
};
#endif /* RSAENCRYPTOR_H_ */
I use latest version of Eclipse Neon for C++ development on Windows 10 x64 machine.
Also I have read this:
(...) you will need to configure with no-async when building OpenSSL 1.1.0 and above for Windows XP or Vista
And I was guided by following instructions.
What did I do:
install Ubuntu 17.04 x64 inside Virtual Box under Windows 10 x64.
download latest version of OpenSSL library from Ubuntu
install mxe and all requirements (but can't compile with it and I decide to use mingw32)
install mingw32 via root#user-pc:/home/user# apt-get install gcc-mingw-w64-i686
unpack OpenSSL library in /home/user/openssl-x32
go to /home/user/openssl-x32
run ./Configure mingw --cross-compile-prefix=i686-w64-mingw32 --prefix=/home/user/builds/openssl-x32-static no-shared no-async
run make
run make install
copy libssl.a and libcrypto.a from /home/user/builds/openssl-x32-static/lib to host machine (Windows 10 x64) to folder E:\MyProjects\my-app\libraries\
copy include directory from Ubuntu to host machine in folder E:\MyProjects\my-app\include
Add libraries folder to linker configurations
Add include folder to compiler configurations
Then, I build my project and got following answer:
11:58:09 **** Rebuild of configuration Debug for project app ****
Info: Configuration "Debug" uses tool-chain "MinGW GCC" that is
unsupported on this system, attempting to build anyway. Info: Internal
Builder is used for build g++
"-IC:\MyProjects\my-app\include" -O0 -g3
-Wall -c -std=c++11 -m32 -o RsaEncryptor.o "..\RsaEncryptor.cpp" g++ "-IC:\MyProjects\my-app\include" -O0 -g3
-Wall -c -std=c++11 -m32 -o main.o "..\main.cpp" In file included from ..\main.cpp:5:0: ..\FilesFinder.h: In member function 'void
FilesFinder::FindRecursively(const string&, const FilesFilter&)':
..\FilesFinder.h:90:56: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
while (destinationContainer.GetElementsCount() >= MAX_ELEMENTS_COUNT) {
^ g++ "-IC:\MyProjects\my-app\include" -O0 -g3
-Wall -c -std=c++11 -m32 -o aes256.o "..\aes256.cpp" g++ "-LC:\MyProjects\my-app\libraries"
-static-libgcc -static-libstdc++ -static -lpthread -m32 -o C:/MyProjects/my-app/bin/Debug/app
RsaEncryptor.o aes256.o main.o -lssl -lcrypto -lgdi32
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0xaa):
undefined reference to _imp__getnameinfo#28'
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0xe0):
undefined reference to_imp__ntohs#4'
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0x242):
undefined reference to gai_strerrorW'
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0x820):
undefined reference to_imp__freeaddrinfo#4'
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0xb5d):
undefined reference to _imp__getaddrinfo#16'
C:\MyProjects\my-app\libraries\libcrypto.a(b_addr.o):b_addr.c:(.text+0xba2):
undefined reference togai_strerrorW'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xd7):
undefined reference to _imp__WSAStartup#8'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xe8):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x2c7):
undefined reference to _imp__WSAStartup#8'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x2d8):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x3b1):
undefined reference to _imp__ntohs#4'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x40c):
undefined reference to_imp__getsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x423):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x43c):
undefined reference to_imp__gethostbyname#4'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x48b):
undefined reference to _imp__WSAStartup#8'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x4a2):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x52c):
undefined reference to _imp__WSACleanup#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x54d):
undefined reference to_imp__ioctlsocket#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x563):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x6b7):
undefined reference to_imp__WSAStartup#8'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x6c8):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x942):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0x9dc):
undefined reference to _imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xa15):
undefined reference to_imp__ioctlsocket#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xa32):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xaa6):
undefined reference to_imp__getsockname#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock.o):b_sock.c:(.text+0xb22):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x27):
undefined reference to_imp__socket#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x4e):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x120):
undefined reference to_imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x15b):
undefined reference to _imp__connect#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x1f5):
undefined reference to_imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x206):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x265):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x2c6):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x377):
undefined reference to_imp__getsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x38f):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x4a7):
undefined reference to_imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x4b4):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x53a):
undefined reference to_imp__bind#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x55f):
undefined reference to _imp__listen#8'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x5a5):
undefined reference to_imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x5b6):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x63a):
undefined reference to_imp__setsockopt#20'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x64b):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x6b2):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x713):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x7a6):
undefined reference to_imp__accept#12'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x7e7):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x84b):
undefined reference to_imp__closesocket#4'
C:\MyProjects\my-app\libraries\libcrypto.a(b_sock2.o):b_sock2.c:(.text+0x86c):
undefined reference to _imp__closesocket#4'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x1b1):
undefined reference to_imp__WSASetLastError#4'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x1d0):
undefined reference to _imp__send#16'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x20a):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x272):
undefined reference to _imp__WSASetLastError#4'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x299):
undefined reference to_imp__send#16'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x2ca):
undefined reference to _imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x33d):
undefined reference to_imp__WSASetLastError#4'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x360):
undefined reference to _imp__recv#16'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x39a):
undefined reference to_imp__WSAGetLastError#0'
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):bss_sock.c:(.text+0x457):
undefined reference to _imp__WSAGetLastError#0'
c:/programs/mingw_w64_mingw32_gcc_stdthread_win32/bin/../lib/gcc/i686-w64-mingw32/4.8.1/../../../../i686-w64-mingw32/bin/ld.exe:
C:\MyProjects\my-app\libraries\libcrypto.a(bss_sock.o):
bad reloc address 0x24 in section.rdata'
c:/programs/mingw_w64_mingw32_gcc_stdthread_win32/bin/../lib/gcc/i686-w64-mingw32/4.8.1/../../../../i686-w64-mingw32/bin/ld.exe:
final link failed: Invalid operation collect2.exe: error: ld returned
1 exit status
11:58:21 Build Finished (took 11s.567ms)
I need just link my completed C++ project with correct-compiled (with flag no-async) OpenSSL library to let it work under old versions of Windows.
I will be happy to get any help with this issue.
Most if not all of the undefined symbols in your error log come from Winsock. Try linking with -lws2_32.

How can do I link libevent that has been configured to have a different prefix?

I am trying to link libevent using g++ but am having trouble since I set libevent's install directory with the --prefix flag when configuring. To install libevent I downloaded the latest source, extracted it and ran the following commands in the directory
./configure --prefix=/home/tom/local --disable-shared && make
make install
After running these commands libevent successfully installs to the /home/tom/local folder. Now to test that I can use libevent I have downloaded the sample rot13 server with libevent that can be found towards the bottom of: http://www.wangafu.net/~nickm/libevent-book/01_intro.html
To compile I run the following command:
g++ -I=/home/tom/local/include rot13server.cpp -L/home/tom/local/lib
But I get the following compilation errors:
/tmp/cctwJY4k.o: In function `alloc_fd_state(event_base*, int)':
libevent.cc:(.text+0x9b): undefined reference to `event_new'
libevent.cc:(.text+0xec): undefined reference to `event_new'
libevent.cc:(.text+0x11a): undefined reference to `event_free'
/tmp/cctwJY4k.o: In function `free_fd_state(fd_state*)':
libevent.cc:(.text+0x1b6): undefined reference to `event_free'
libevent.cc:(.text+0x1c9): undefined reference to `event_free'
/tmp/cctwJY4k.o: In function `do_read(int, short, void*)':
libevent.cc:(.text+0x310): undefined reference to `event_add'
/tmp/cctwJY4k.o: In function `do_write(int, short, void*)':
libevent.cc:(.text+0x4da): undefined reference to `event_del'
/tmp/cctwJY4k.o: In function `do_accept(int, short, void*)':
libevent.cc:(.text+0x564): undefined reference to `evutil_make_socket_nonblocking'
libevent.cc:(.text+0x5da): undefined reference to `event_add'
/tmp/cctwJY4k.o: In function `run()':
libevent.cc:(.text+0x5f3): undefined reference to `event_base_new'
libevent.cc:(.text+0x63f): undefined reference to `evutil_make_socket_nonblocking'
libevent.cc:(.text+0x6d2): undefined reference to `event_new'
libevent.cc:(.text+0x6e7): undefined reference to `event_add'
libevent.cc:(.text+0x6f3): undefined reference to `event_base_dispatch'
collect2: error: ld returned 1 exit status
It seems like the compiler is finding the include files but not the object files.
I also tried configuring libevent without the --disable-shared option and then exported /home/tom/local/lib to the LD_LIBRARY_PATH but I still get the same error with the compile command:
g++ -I=/home/tom/local/include rot13server.cpp
Can anyone tell me what I am doing wrong?
Thanks
Can anyone tell me what I am doing wrong?
Just about everything.
The -I=/home/tom/local/include tells GCC to look in =/home/tom/local/include directory, which is unlikely to exist.
You want:
g++ -I/home/tom/local/include rot13server.cpp -c
g++ -L/home/tom/local/lib rot13server.o -levent -o rot13server

linker error while building roborobo using SDL

I'm using robo robo simulator. It requires SDL to be installed. SDL was successfully installed using sudo apt-get install in Ubuntu
'make' was used to compile and link.
compilation was successful but while linking I got the following linker errors
[LD] roborobo
src/core/roborobo.o: In function `clean_up()':
roborobo.cpp:(.text+0x29): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x35): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x41): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x4d): undefined reference to `SDL_FreeSurface'
roborobo.cpp:(.text+0x59): undefined reference to `SDL_FreeSurface'
src/core/roborobo.o:roborobo.cpp:(.text+0x6a): more undefined references to `SDL_FreeSurface' follow
src/core/roborobo.o: In function `checkQuitEvent()':
roborobo.cpp:(.text+0xdff): undefined reference to `SDL_PollEvent'
src/core/roborobo.o: In function `handleKeyEvent(unsigned char*)':
roborobo.cpp:(.text+0xead): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0xf1a): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0xf43): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0x1037): undefined reference to `SDL_Delay'
roborobo.cpp:(.text+0x111e): undefined reference to `SDL_Delay'
src/core/roborobo.o:roborobo.cpp:(.text+0x1191): more undefined references to `SDL_Delay' follow
and many more
SDL_gfxPrimitives.c:(.text+0x7477): undefined reference to `SDL_UnlockSurface'
SDL_gfxPrimitives.c:(.text+0x7491): undefined reference to `SDL_UpperBlit'
SDL_gfxPrimitives.c:(.text+0x74e6): undefined reference to `SDL_CreateRGBSurface'
collect2: error: ld returned 1 exit status
make: [roborobo] Error 1 (ignored)
the make file also has sdl-config --cflags --libs -lSDL_image
the Makefile is in http://pastebin.com/5EdcZWAd
the entire console output after 'make' is in http://pastebin.com/yXDHR9xw

undefined reference but I have installed libical

I am trying to compile and run cyrus-imapd-2.4.17-caldav-beta9.
This project has a file called configure which creates the makefile.
When I run the makefile I get errors "undefined reference to...".
One of these references is lost libical which I have installed.
In fact I have installed:
apt-get install libdb-dev
apt-get install libsasl2-dev
apt-get install libsnmp-dev
apt-get install libxml2-dev
apt-get install libical-dev
apt-get install libsqlite3-dev
I generate makefile as follow:
CFLAGS=-I/usr/include/libxml2 ./configure --enable-murder
Run the makefile as follows:
CFLAGS=-I/usr/include/libxml2/libxml make
Some of the errors:
http_caldav.o: In function `is_valid_timerange':
http_caldav.c:(.text+0x3c86): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3cd8): undefined reference to `icaltime_is_valid_time'
http_caldav.c:(.text+0x3d2a): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3d7c): undefined reference to `icaltime_is_date'
http_caldav.c:(.text+0x3dce): undefined reference to `icaltime_is_utc'
http_caldav.c:(.text+0x3e23): undefined reference to `icaltime_is_utc'
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x3e7d): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3e98): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x3eb7): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f02): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f19): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f46): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x3f71): undefined reference to `xmlStrcmp'
http_caldav.o:http_caldav.c:(.text+0x3f9c): more undefined references to `xmlStrcmp' follow
http_caldav.o: In function `parse_comp_filter':
http_caldav.c:(.text+0x4077): undefined reference to `xmlFree'
http_caldav.c:(.text+0x40cc): undefined reference to `xmlStrcmp'
http_caldav.c:(.text+0x40d9): undefined reference to `icaltimezone_get_utc_timezone'
http_caldav.c:(.text+0x410f): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x412d): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4171): undefined reference to `xmlFree'
http_caldav.c:(.text+0x41a0): undefined reference to `icaltime_from_timet_with_zone'
http_caldav.c:(.text+0x41f2): undefined reference to `xmlGetProp'
http_caldav.c:(.text+0x4210): undefined reference to `icaltime_from_string'
http_caldav.c:(.text+0x4254): undefined reference to `xmlFree'
http_caldav.c:(.text+0x4283): undefined reference to `icaltime_from_timet_with_zone'
How could I solve this problem of missing references?,
Thanks.

OpenNI linking erros, lots of undefined references

I am driving nuts....
I'm working on a program to read out Joint Coordinates from an Xtion Primesense sensor with OpenNI and NiTE. I got the program splittet in 3 parts. Main, sensorOpenNI.hpp and sensorOpenNI.cpp. Now while linking the parts together I get lots of errors saying there are undefined references to some NiTE functions. I'm working with Kubuntu and g++. The NiTE and OpenNI libs are in a directory called Include...
Here's the error message:
/tmp/ccrPQHEg.o: In function openni::VideoFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference tooniFrameRelease'
/tmp/ccrPQHEg.o: In function openni::VideoFrameRef::_setFrame(OniFrame*)':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference tooniFrameAddRef'
/tmp/ccrPQHEg.o: In function nite::UserTrackerFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference toniteUserTrackerFrameRelease'
/tmp/ccrPQHEg.o: In function nite::UserTracker::create(openni::Device*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference toniteInitializeUserTracker'
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference to niteInitializeUserTrackerByDevice'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::destroy()':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference to niteShutdownUserTracker'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference to niteReadUserTrackerFrame'
/tmp/ccrPQHEg.o: In functionnite::UserTracker::startSkeletonTracking(short)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference to niteStartSkeletonTracking'
/tmp/ccrPQHEg.o: In functionnite::NiTE::initialize()':
sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference to niteInitialize'
collect2: ld returned 1 exit status
patrick#ubuntu:~/Koerpersteuerung$ g++ -c sensorOpenNI.cpp sensorOpenNI.hpp -I Include/
patrick#ubuntu:~/Koerpersteuerung$ g++ mainSensor.cpp sensorOpenNI.o -I Include/
sensorOpenNI.o: In functionopenni::VideoFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference to oniFrameRelease'
sensorOpenNI.o: In functionopenni::VideoFrameRef::_setFrame(OniFrame*)':
sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference to oniFrameAddRef'
sensorOpenNI.o: In functionnite::UserTrackerFrameRef::release()':
sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference to niteUserTrackerFrameRelease'
sensorOpenNI.o: In functionnite::UserTracker::create(openni::Device*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference to niteInitializeUserTracker'
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference toniteInitializeUserTrackerByDevice'
sensorOpenNI.o: In function nite::UserTracker::destroy()':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference toniteShutdownUserTracker'
sensorOpenNI.o: In function nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference toniteReadUserTrackerFrame'
sensorOpenNI.o: In function nite::UserTracker::startSkeletonTracking(short)':
sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference toniteStartSkeletonTracking'
sensorOpenNI.o: In function nite::NiTE::initialize()':
sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference toniteInitialize'
collect2: ld returned 1 exit status
I'm calling g++ like this:
g++ -o test mainSensor.cpp sensorOpenNI.cpp -I Include/
Try copying the libraries libOpenNI2.so and libNiTE2 like that:
sudo cp ./OpenNI-Linux-x86-2.2/Redist/libOpenNI2.so /usr/local/lib
sudo cp ./NiTE-Linux-x86-2.2/Redist/libNiTE2.so /usr/local/lib
then do
sudo ldconfig
and now compile the program by adding -lOpenNI2 -lNiTE2