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 

libwiimote

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



Joined: 08 Nov 2007
Posts: 3

Digg It
PostPosted: Thu Nov 08, 2007 6:12 pm    Post subject: libwiimote

Hey Guys,

I am attempting to compile the example code from libwiimote (and yes, I know this is not exactley WiiLi, but what the hell, right?)

The target machine is Ubuntu 7.10, gcc version 4.1.3 20070929 ( yes, g++ failed as well ), libwiimote4.0 ( 2.0 failed as well, same error )

Here is the code in question:

Code:

#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);
   }
 }



and the compile output is as follows:

Code:


/tmp/ccMso3FV.o: In function `main':
main.cpp:(.text+0x2e): undefined reference to `wiimote_connect(wiimote_t*, char const*)'
main.cpp:(.text+0x45): undefined reference to `wiimote_update(wiimote_t*)'
main.cpp:(.text+0x5b): undefined reference to `wiimote_disconnect(wiimote_t*)'
collect2: ld returned 1 exit status



Cheers,
Tag
_________________
--
Debian 4.0, Ubuntu 7.10, Gentoo 2005.0
Back to top
View user's profile Send private message AIM Address
para



Joined: 20 Aug 2007
Posts: 89

Digg It
PostPosted: Thu Nov 08, 2007 10:46 pm    Post subject:

Looks like you aren't linking the libwiimote stuff.
_________________
wiiuse C wiimote library - http://wiiuse.net/
Back to top
View user's profile Send private message Visit poster's website
tag



Joined: 08 Nov 2007
Posts: 3

Digg It
PostPosted: Fri Nov 09, 2007 1:10 am    Post subject: tag

para -

going from standard to using nonstandard includes has been a bit rough for me, I am compiling code with this kluge of a command:

Code:

g++ main.cpp -o Wii -I /home/tag/Desktop/libwiimote-0.4/src/

( I know, I know )

what would the appropriate argument set?

Cheers,
Tag
_________________
--
Debian 4.0, Ubuntu 7.10, Gentoo 2005.0
Back to top
View user's profile Send private message AIM Address
para



Joined: 20 Aug 2007
Posts: 89

Digg It
PostPosted: Fri Nov 09, 2007 3:00 am    Post subject:

I haven't used libwiimote, but you probably have to link it since it's looking for those functions at link-time and isn't finding them:

Code:
# g++ -c main.cpp -I /home/tag/Desktop/libwiimote-0.4/src/
# g++ main.o libwiimote.o -o Wii


Something like that.
_________________
wiiuse C wiimote library - http://wiiuse.net/
Back to top
View user's profile Send private message Visit poster's website
tag



Joined: 08 Nov 2007
Posts: 3

Digg It
PostPosted: Fri Nov 09, 2007 3:11 am    Post subject:

Hey,

I have found the .so library and linked, but it still seems to be decidedly rebellious.

is wiiuse a better call, and if so what would the compile arguments look like?

Cheers,
Tag
_________________
--
Debian 4.0, Ubuntu 7.10, Gentoo 2005.0
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> WiiLi Applications 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