NO SE QUE HACER, compilación libwiimote 0.4

Hola eolianos, esta mañana me he puesto a probar el mando de wii con mi bluetooth mediante este tuto y me lo detecta perfectamente, pero cuando me pongo a compilar la libwiimote me sale esto:
edu@edu-desktop:~/Wii/libwiimote-0.4$ autoconf
edu@edu-desktop:~/Wii/libwiimote-0.4$ ./configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking for hci_remote_name in -lbluetooth... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating test/Makefile
edu@edu-desktop:~/Wii/libwiimote-0.4$ make
make[1]: se ingresa al directorio `/home/edu/Wii/libwiimote-0.4/src'
gcc -Os -Wall -pipe -D_ENABLE_TILT -D_ENABLE_FORCE -g -O2 -I../src wiimote_link.c wiimote_ir.c wiimote_event.c wiimote_io.c wiimote_report.c wiimote_api.c wiimote_error.c wiimote_speaker.c wiimote_mii.c wiimote_classic.c wiimote_nunchuk.c -shared -o libcwiimote.so
/usr/bin/ld: /tmp/cckybD2l.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/cckybD2l.o: could not read symbols: Bad value
collect2: ld devolvió el estado de salida 1
make[1]: *** [libcwiimote.so] Error 1
make[1]: se sale del directorio `/home/edu/Wii/libwiimote-0.4/src'
make: *** [subdirs] Error 1
edu@edu-desktop:~/Wii/libwiimote-0.4$

Estoy desesperado, llevo toda mañana googleando y metiendome en foros, ya no sé que mas hacer... si alguien de por aquí me pudiese ayudar se lo agradecería.

P.D.: es un ubuntu 7.04 feisty fawn 64
P.D2: si alguien me pasa un deb precompilado tampoco me vendría mal :D

Salu2
recompile with -fPIC


Sabiendo que -fPIC es una CFLAG....

make CFLAGS+=-fPIC


- ferdy
¿Y si editas el makefile y añades la opción -fPIC a la hora de compilar?
¿Y si editas el makefile y añades la opción -fPIC a la hora de compilar?


Por lo general es una mala idea ya que los .o no se listan en los Makefile ya que caen dentro de las reglas implícitas de make. Así que en el Makefile estará la generación del binario o, en este caso, la librería.

Otra solución (la buena) es darle un capón al que hace esa librería y obligarle a usar libtool.

- ferdy
Ferdy escribió:
Sabiendo que -fPIC es una CFLAG....

make CFLAGS+=-fPIC


- ferdy

No hay cojones, me sale esto

terminal escribió:edu@edu-desktop:~/Wii/libwiimote-0.4$ make CFLAGS+=-fPIC
make[1]: se ingresa al directorio `/home/edu/Wii/libwiimote-0.4/src'
gcc -fPIC -I../src wiimote_link.c wiimote_ir.c wiimote_event.c wiimote_io.c wiimote_report.c wiimote_api.c wiimote_error.c wiimote_speaker.c wiimote_mii.c wiimote_classic.c wiimote_nunchuk.c -shared -o libcwiimote.so
make[1]: se sale del directorio `/home/edu/Wii/libwiimote-0.4/src'
make[1]: se ingresa al directorio `/home/edu/Wii/libwiimote-0.4/test'
gcc -fPIC -I../src -o ../bin/test1 test1.c -L../lib -lcwiimote -lbluetooth -lm
gcc -fPIC -I../src -o ../bin/test2 test2.c -L../lib -lcwiimote -lbluetooth -lm
test2.c: En la función ‘main’:
test2.c:96: error: ‘wiimote_t’ no tiene un miembro llamado ‘tilt’
test2.c:97: error: ‘wiimote_t’ no tiene un miembro llamado ‘tilt’
make[1]: *** [test2] Error 1
make[1]: se sale del directorio `/home/edu/Wii/libwiimote-0.4/test'
make: *** [subdirs] Error 1


ferdy escribió:Otra solución (la buena) es darle un capón al que hace esa librería y obligarle a usar libtool.


Y eso como lo hago, ¿me meto en el bug tracker de sourceforge y se lo explico??? XD, mi inglés no es ni muchisimo menos perfecto (soy estudiante de instituto). si alguien se lo pudiese decir por mí XDDD

Salu2
P.D.: aunque ha dado error, inspeccionando la carpeta lib me he encontrado con esto:
terminal2 escribió:edu@edu-desktop:~/Wii/libwiimote-0.4/lib$ ls
libcwiimote.a libcwiimote.so
edu@edu-desktop:~/Wii/libwiimote-0.4/lib$


SUPEREDIT: YA FUNCIONA, a pesar de darme el mismo error que antes he rulado sudo make install y ha funcionado [beer] soys unos cracks!!!!!!!
P.D2: no sólo eso, sino que la opción de cflags fpic he podido hasta compilar el XBMC!
4 respuestas