Anmelden

Archiv verlassen und diese Seite im Standarddesign anzeigen : Fehler No.2 bei make bei libwiimote-0.4



nomad
12-10-2008, 12:11
Fehler No.2 bei make bei libwiimote-0.4

hi
das naechste problem taucht bei
libwiimote-0.4 auf:
vorgehen:
- autoconf
- ./configure OK
- make -> fehler mit


make[1]: Entering directory `/root/Desktop/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/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: /tmp/cco9flr8.o: relocation R_X86_64_32 against `a local symbol'

can not be used when making a shared object; recompile with -fPIC

/tmp/cco9flr8.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libcwiimote.so] Error 1
make[1]: Leaving directory `/root/Desktop/libwiimote-0.4/src'
make: *** [subdirs] Error 1
linux-753o:~/Desktop/libwiimote-0.4 #



da ich mit make nicht so viel erfahrung habe, wuesste ich gerne
wie "make" das mit: recompile with -fPIC meint.
und wie ich das copmpilieren kann.

das make-file sieht so aus.



# Makefile

PACKAGE_VERSION = 0.4.0

prefix = /usr/local
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
libwiimote_includedir = $(includedir)/libcwiimote-$(PACKAGE_VERSION)/libcwiimote

INSTALL = /usr/bin/install -c

topdir=.
include $(topdir)/config.mk

subdirs=src test

all: subdirs

subdirs:
@for dir in $(subdirs); do \
(cd $$dir && make) || exit 1; \
done

install:
mkdir -p $(DESTDIR)$(libdir) $(DESTDIR)$(libwiimote_includedir)
$(INSTALL) -m 755 $(LIBDIR)/libcwiimote.so $(DESTDIR)$(libdir)/libcwiimote.so.$(PACKAGE_VERSION)
$(INSTALL) -m 755 $(LIBDIR)/libcwiimote.a $(DESTDIR)$(libdir)/libcwiimote.a
for i in $(SRCDIR)/*.h; do \
$(INSTALL) -m 644 $$i $(DESTDIR)$(libwiimote_includedir); \
done

uninstall:
rm -rf $(DESTDIR)$(libwiimote_includedir)
rm -f $(DESTDIR)$(libdir)/libcwiimote.a
rm -f $(DESTDIR)$(libdir)/libcwiimote.so.$(PACKAGE_VERSION)

clean:
@rm -f *~
@rm -f bin/* lib/*
@for dir in $(subdirs); do \
(cd $$dir && make clean) || exit 1; \
done

distclean: clean
rm -f Makefile config.log config.status



auch hier bin ich um jede hilfe dankbar

ich hab's auch schon in den usa-versucht, durch den bloedsinnigen zeitunterschied
bis jetzt nicht gefunden

als entschuldigt den aufwand
gruss
nomad

nomad
14-10-2008, 09:17
hi
Loesung:
da make verlangt dass mit -fPIC compiliert wird, hab ich folgendes gemacht:
in folder /test/ befinden sich 4 (test1.c - test4.c) programme und ein make-file.
1) original make-file laufen gelassen:



cc -Os -Wall -pipe -D_ENABLE_TILT -D_ENABLE_FORCE -g -O2 -I../src -o ../bin/test1 test1.c -L../lib -lcwiimote -lbluetooth -lm


2) diesen compile-vorgang ohne make mit der ergaenzung -fPIC compiliert



cc -Os -Wall -pipe -fPIC -D_ENABLE_TILT -D_ENABLE_FORCE -g -O2 -I../src -o ../bin/test1 test1.c -L../lib -lcwiimote -lbluetooth -lm


3) ergebnis: in folder /bin/ 4 ausfuehrbare test-programme.

hab sie probeweise laufengelassen
funzzt prima

hinweis: die programme erwarten als argument die MAC-adresse des wiimote-controllers
kann mit hcitool scan
herausgefunden werden
gruss nomad