Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build. #3

Open
curiousmuch opened this issue Jun 8, 2015 · 6 comments
Open

Failed to build. #3

curiousmuch opened this issue Jun 8, 2015 · 6 comments

Comments

@curiousmuch
Copy link

Hello,

I'm hoping you guys could help me.
I'm receiving the following error when I attempt to build the bindings. I have installed xwiimote and libxwiimote-dev. I am using ubuntu 15.04. Do you guys have any idea of what is going on. I'm sorry if this an easy question, I could not find any answers online.

Thanks!

tyler@tyler-Latitude-E6410:~/Downloads/xwiimote-bindings-master$ sudo make
make --no-print-directory all-recursive
Making all in .
/usr/bin/python python/setup.py build_ext
running build_ext
building '_xwiimote' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include -I/usr/include/python2.7 -c xwiimote_wrap.c -o build/temp.linux-x86_64-2.7/xwiimote_wrap.o
xwiimote_wrap.c: In function ‘xwii_event_xe_get_abs’:
xwiimote_wrap.c:3312:16: error: ‘XWII_ABS_NUM’ undeclared (first use in this function)
if(n<0 || n>=XWII_ABS_NUM)
^
xwiimote_wrap.c:3312:16: note: each undeclared identifier is reported only once for each function it appears in
xwiimote_wrap.c: In function ‘xwii_event_xe_set_abs’:
xwiimote_wrap.c:3322:16: error: ‘XWII_ABS_NUM’ undeclared (first use in this function)
if(n<0 || n>=XWII_ABS_NUM)
^
xwiimote_wrap.c: In function ‘xwii_event_xe_ir_is_valid’:
xwiimote_wrap.c:3348:16: error: ‘XWII_ABS_NUM’ undeclared (first use in this function)
if(n<0 || n>=XWII_ABS_NUM) /* avoid a segfault _/
^
xwiimote_wrap.c: In function ‘xwii_iface_xif_get_syspath’:
xwiimote_wrap.c:3474:3: warning: implicit declaration of function ‘xwii_iface_get_syspath’ [-Wimplicit-function-declaration]
if((syspath = xwii_iface_get_syspath(self)) == NULL)
^
xwiimote_wrap.c:3474:15: warning: assignment makes pointer from integer without a cast
if((syspath = xwii_iface_get_syspath(self)) == NULL)
^
xwiimote_wrap.c: In function ‘xwii_iface_xif_get_name’:
xwiimote_wrap.c:3574:3: warning: implicit declaration of function ‘xwii_get_iface_name’ [-Wimplicit-function-declaration]
return xwii_get_iface_name(iface);
^
xwiimote_wrap.c:3574:3: warning: return makes pointer from integer without a cast
xwiimote_wrap.c: In function ‘init_xwiimote’:
xwiimote_wrap.c:5692:81: error: ‘XWII_EVENT_CLASSIC_CONTROLLER_KEY’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_CLASSIC_CONTROLLER_KEY",SWIG_From_int((int)(XWII_EVENT_CLASSIC_CONTROLLER_KEY)));
^
xwiimote_wrap.c:5693:82: error: ‘XWII_EVENT_CLASSIC_CONTROLLER_MOVE’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_CLASSIC_CONTROLLER_MOVE",SWIG_From_int((int)(XWII_EVENT_CLASSIC_CONTROLLER_MOVE)));
^
xwiimote_wrap.c:5694:70: error: ‘XWII_EVENT_NUNCHUK_KEY’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_NUNCHUK_KEY",SWIG_From_int((int)(XWII_EVENT_NUNCHUK_KEY)));
^
xwiimote_wrap.c:5695:71: error: ‘XWII_EVENT_NUNCHUK_MOVE’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_NUNCHUK_MOVE",SWIG_From_int((int)(XWII_EVENT_NUNCHUK_MOVE)));
^
xwiimote_wrap.c:5696:68: error: ‘XWII_EVENT_DRUMS_KEY’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_DRUMS_KEY",SWIG_From_int((int)(XWII_EVENT_DRUMS_KEY)));
^
xwiimote_wrap.c:5697:69: error: ‘XWII_EVENT_DRUMS_MOVE’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_DRUMS_MOVE",SWIG_From_int((int)(XWII_EVENT_DRUMS_MOVE)));
^
xwiimote_wrap.c:5698:69: error: ‘XWII_EVENT_GUITAR_KEY’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_GUITAR_KEY",SWIG_From_int((int)(XWII_EVENT_GUITAR_KEY)));
^
xwiimote_wrap.c:5699:70: error: ‘XWII_EVENT_GUITAR_MOVE’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_GUITAR_MOVE",SWIG_From_int((int)(XWII_EVENT_GUITAR_MOVE)));
^
xwiimote_wrap.c:5700:63: error: ‘XWII_EVENT_GONE’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "EVENT_GONE",SWIG_From_int((int)(XWII_EVENT_GONE)));
^
xwiimote_wrap.c:5721:58: error: ‘XWII_KEY_C’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_C",SWIG_From_int((int)(XWII_KEY_C)));
^
xwiimote_wrap.c:5722:58: error: ‘XWII_KEY_Z’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_Z",SWIG_From_int((int)(XWII_KEY_Z)));
^
xwiimote_wrap.c:5723:69: error: ‘XWII_KEY_STRUM_BAR_UP’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_STRUM_BAR_UP",SWIG_From_int((int)(XWII_KEY_STRUM_BAR_UP)));
^
xwiimote_wrap.c:5724:71: error: ‘XWII_KEY_STRUM_BAR_DOWN’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_STRUM_BAR_DOWN",SWIG_From_int((int)(XWII_KEY_STRUM_BAR_DOWN)));
^
xwiimote_wrap.c:5725:68: error: ‘XWII_KEY_FRET_FAR_UP’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_FRET_FAR_UP",SWIG_From_int((int)(XWII_KEY_FRET_FAR_UP)));
^
xwiimote_wrap.c:5726:64: error: ‘XWII_KEY_FRET_UP’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_FRET_UP",SWIG_From_int((int)(XWII_KEY_FRET_UP)));
^
xwiimote_wrap.c:5727:65: error: ‘XWII_KEY_FRET_MID’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_FRET_MID",SWIG_From_int((int)(XWII_KEY_FRET_MID)));
^
xwiimote_wrap.c:5728:65: error: ‘XWII_KEY_FRET_LOW’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_FRET_LOW",SWIG_From_int((int)(XWII_KEY_FRET_LOW)));
^
xwiimote_wrap.c:5729:69: error: ‘XWII_KEY_FRET_FAR_LOW’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "KEY_FRET_FAR_LOW",SWIG_From_int((int)(XWII_KEY_FRET_FAR_LOW)));
^
xwiimote_wrap.c:5731:66: error: ‘XWII_DRUMS_ABS_PAD’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_PAD",SWIG_From_int((int)(XWII_DRUMS_ABS_PAD)));
^
xwiimote_wrap.c:5732:74: error: ‘XWII_DRUMS_ABS_CYMBAL_LEFT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_CYMBAL_LEFT",SWIG_From_int((int)(XWII_DRUMS_ABS_CYMBAL_LEFT)));
^
xwiimote_wrap.c:5733:75: error: ‘XWII_DRUMS_ABS_CYMBAL_RIGHT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_CYMBAL_RIGHT",SWIG_From_int((int)(XWII_DRUMS_ABS_CYMBAL_RIGHT)));
^
xwiimote_wrap.c:5734:71: error: ‘XWII_DRUMS_ABS_TOM_LEFT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_TOM_LEFT",SWIG_From_int((int)(XWII_DRUMS_ABS_TOM_LEFT)));
^
xwiimote_wrap.c:5735:72: error: ‘XWII_DRUMS_ABS_TOM_RIGHT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_TOM_RIGHT",SWIG_From_int((int)(XWII_DRUMS_ABS_TOM_RIGHT)));
^
xwiimote_wrap.c:5736:76: error: ‘XWII_DRUMS_ABS_TOM_FAR_RIGHT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_TOM_FAR_RIGHT",SWIG_From_int((int)(XWII_DRUMS_ABS_TOM_FAR_RIGHT)));
^
xwiimote_wrap.c:5737:67: error: ‘XWII_DRUMS_ABS_BASS’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_BASS",SWIG_From_int((int)(XWII_DRUMS_ABS_BASS)));
^
xwiimote_wrap.c:5738:69: error: ‘XWII_DRUMS_ABS_HI_HAT’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_HI_HAT",SWIG_From_int((int)(XWII_DRUMS_ABS_HI_HAT)));
^
xwiimote_wrap.c:5739:66: error: ‘XWII_DRUMS_ABS_NUM’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "DRUMS_ABS_NUM",SWIG_From_int((int)(XWII_DRUMS_ABS_NUM)));
^
xwiimote_wrap.c:5748:64: error: ‘XWII_IFACE_DRUMS’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "IFACE_DRUMS",SWIG_From_int((int)(XWII_IFACE_DRUMS)));
^
xwiimote_wrap.c:5749:65: error: ‘XWII_IFACE_GUITAR’ undeclared (first use in this function)
SWIG_Python_SetConstant(d, "IFACE_GUITAR",SWIG_From_int((int)(XWII_IFACE_GUITAR)));
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Makefile:880: recipe for target 'xwiimote.so' failed
make[2]: *
* [_xwiimote.so] Error 1
Makefile:457: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
Makefile:384: recipe for target 'all' failed
make: *** [all] Error 2

@curiousmuch
Copy link
Author

It appears when I install xwiimote, I also installs libxwiimote2 which also contains the libraries. If I attempt to build the bindings without libxwiimote-dev I cannot complete the autogen.sh script.

Thanks for any help you can provide!

@mitras2
Copy link

mitras2 commented Jun 25, 2015

Hi @curiousmuch
I'm currently trying to work with the xwiimote-bindings and python. My system ist based on Arch Linux. In the beginning I had the same problem like you, when i tried to compile the xwiimote-bindings.

I got the problem solved by uninstalling all xwiimote -related pakages (in my case only xwiimote) and then compiling xwiimote by hand. After that i did try to complile the xwiimote-bindings by hand. And yes - this time it did work without all the "error: ‘XWII_IFACE_GUITAR’ undeclared" messages.

The problem could be the fact that packages you install using apt (or in my case pacman) normaly will be installed in /usr/bin/* and /usr/lib/.
xwiimote-bindings seams to need some of this packages in the "/usr/local/lib/
" and /usr/local/bin/*"-Paths (this is at least what i think solved my problem)

BTW:
I had to do two other things bevor compiling:

  1. I had to save the path "/usr/local/lib/pkgconfig" to the PATH-Var "PKG_CONFIG_PATH". xwiimote puts a file there (called libxwiimote.pc) that is necessary for xwiimote-bindings to build.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
  1. The example scripts in the folder xwiimote-bindings/examples/python/* are written for python2 NOT for python3. You might want to change your primary pythin version from 3.4 to python2.7 by:
sudo ln -svb ./python2 /usr/bin/python

which replaces the simlink /usr/bin/python with a version that points to python2

If you do have any questions on how to build this, just ask.
I have spend the last to days only in trying to understand more of how the build of this stuff works.

UPDATE:
Changing the PREFIX in the config-flags to /usr (instead the standart /usr/local might be another solution, even if it's not technicaly beautiful.

@mrkskwsnck
Copy link

By following your comments I was able to succesfully compile xwiimote and xwiimote-bindings on my Raspbian Jessie. Anyway, I installed them without using sudo in my home directory due to development purpose. Now, when I try to import the xwiimote module in Python 2.7 I get the following error:

ImportError: /usr/lib/arm-linux-gnueabihf/libxwiimote.so.2: version `LIBXWIIMOTE_3' not found (required by /home/pi/usr/local/lib/python2.7/site-packages/_xwiimote.so)

What is wrong here? Any hint would be very appreciated to get this finally to work.

@mitras2
Copy link

mitras2 commented Jan 4, 2016

Hi @mrkskwsnck

Sorry for replying that late. I'm not quite shure wether i got the same error once. I think in my case libxwiimote.so.2 / libxwiimote.so.2.0.0 was not found at all.
What helped me was:

  1. First ensure, that you have a libxwiimote.so.2
    In my case it has ben installed to /usr/local/lib
    (libxwiimote.so.2 was a symlink to libxwiimote.so.2.0.0 in the same directory)
  2. Second - Add the the path to the ldconfig:

To make python find libxwiimote.so.2 I had to edit ld.so.conf
Using

sudo nano /etc/ld.so.conf

I added the path pointing to libxwiimote.so.2

/usr/local/lib/

in the line above

# End of file

After saving the file, I had to call

ldconfig

to set this change in the system. This way python was able to find my libxwiimote.so.2 in /usr/local/lib

I hope this helps - Even if I had another error-message...
Would be nice to hear wether it worked ;-) - Thanks

@mrkskwsnck
Copy link

@mitras2 Thank you very much for your help. Finally I got it to work now!!1

With your last hint I realized the library file libxwiimote.so.2 was not missing but did not match my self compiled version of the bindings. As I mentioned before I installed xwiimote and xwiimote-bindings in the user's home folder and I still had the outdated Jessie packages installed. So, after removing all xwiimote related Jessie packages I added the library path in the user's home folder to /etc/ld.so.conf as you said and now it just works with the examples.

@PureTryOut
Copy link

To be exact (and for anyone trying to build this not on Debian based distros): the problem is that the last and only release of xwiimote, version 2, does not work with xwiimote-bindings currently. You'll need to compile it using the latest git master. That Jessie repo obviously just builds version 2 and thus won't work.

This issue can be closed, OP just needs a more recent xwiimote. CC @dvdhrm and/or @nadenislamarre

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants