WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem compiling test example

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> CWiid
View previous topic :: View next topic  
Author Message
sambuls



Joined: 08 Sep 2008
Posts: 2

Digg It
PostPosted: 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.oSad.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,
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> CWiid All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group