sambuls
Joined: 08 Sep 2008 Posts: 2
Digg It |
Posted: Wed Sep 10, 2008 4:23 pm Post subject: problem compiling test example |
|
|
hello,
I've downloaded the libcwiimote en libcwiimote-devel packages.
The last 4 days I've been trying to compile the libcwiimote test example
but it fails...
[sambuls@localhost c]$ gcc main.cpp -I /usr/include/libcwiimote/
#include <stdio.h>
#include "wiimote_api.h"
int main(){
wiimote_t wi;
wiimote_connect(&wi, "00:1B:7A:EB:28:30");
wi.mode.acc = 1; // enable accelerometer
while (wiimote_is_open(&wi)) {
wiimote_update(&wi); // synchronize with wiimote
if (wi.keys.home) { // check if home key is pressed
wiimote_disconnect(&wi);
}
printf("x=%d y=%d z=%d\n", wi.axis.x, wi.axis.y, wi.axis.z);
}
}
I get compile error's:
/tmp/ccYfYGju.o: In function `main':
main.cpp:(.text+0x23): undefined reference to `wiimote_connect(wiimote_t*, char const*)'
main.cpp:(.text+0x3a): undefined reference to `wiimote_update(wiimote_t*)'
main.cpp:(.text+0x50): undefined reference to `wiimote_disconnect(wiimote_t*)'
/tmp/ccYfYGju.o .eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
The directory of the include files : /usr/include/libcwiimote/
The directory of the lib : /usr/lib/libcwiimote.so
Even when I try
[sambuls@localhost c]$ gcc -c main.cpp -I /usr/include/libcwiimote/
[sambuls@localhost c]$ g++ main.o /usr/lib/libcwiimote.so -o wii
main.o: In function `main':
main.cpp:(.text+0x23): undefined reference to `wiimote_connect(wiimote_t*, char const*)'
main.cpp:(.text+0x3a): undefined reference to `wiimote_update(wiimote_t*)'
main.cpp:(.text+0x50): undefined reference to `wiimote_disconnect(wiimote_t*)'
/usr/lib/libcwiimote.so: undefined reference to `hci_close_dev'
/usr/lib/libcwiimote.so: undefined reference to `hci_devba'
/usr/lib/libcwiimote.so: undefined reference to `hci_remote_name'
/usr/lib/libcwiimote.so: undefined reference to `hci_inquiry'
/usr/lib/libcwiimote.so: undefined reference to `hci_get_route'
/usr/lib/libcwiimote.so: undefined reference to `str2ba'
/usr/lib/libcwiimote.so: undefined reference to `ba2str'
/usr/lib/libcwiimote.so: undefined reference to `hci_open_dev'
collect2: ld returned 1 exit status
Can someone give me a hint?
thanks, |
|