2010-02-01 05:26:28     linking against tslib

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2010-02-01 05:26:28     linking against tslib

Georg Greil (AUSTRIA)

Message: 85412   




I am trying to use tslib with my own application to read calibrated samples.


when i try to compile, it says:


undefined reference to `_ts_open'




i included tslib.h but i think the problem is that i did not link my application against tslib.


i tried a lot of things but didn't manage to link against tslib in my makefile.


How can i do this? Which compiler/linker flags do I need ?


i even did not  find tslib library - shouldn't there be someting like tslib.a.


i found "tslib.la" - it has to do something with libadd, but i really dont know anything about such things




i am really new to such things and its hard for me, so please forgive me asking


such things.










2010-02-01 11:30:01     Re: linking against tslib


Message: 85420   




Did you compile things as flat or fdpic?






2010-02-01 22:08:17     Re: linking against tslib


Message: 85432   


Tslib need to be built in FDPIC format, and you can find the tslib libraries (*.so) in uclinux-dist/staging/usr/ after tslib is built correctly.






2010-02-01 23:19:50     Re: linking against tslib

Mike Frysinger (UNITED STATES)

Message: 85437   


if, once you fix the issues raised by Robin & Yi, things still arent working, you should post the exact link command you're using and the exact error output you're seeing




2010-02-02 03:19:23     Re: linking against tslib

Georg Greil (AUSTRIA)

Message: 85462   


i do build everything in fdpic format and included everything which seemed to have anything to do with tslib.


it still can't find the functions from tslib i call. Here is my make - output:


bfin-linux-uclibc-gcc     -mcpu=bf537-0.2 -o iradio iradio.o fbutils.o font_8x8.o font_8x16.o -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/variance.so -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/pthres.so -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/linear.so -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/input.so -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/dejitter.so -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/tslib.la

iradio.o: In function `main':

/home/georg/uclinux/uClinux/uClinux-dist/user/iradio/iradio.c:100: undefined reference to `_ts_open'

/home/georg/uclinux/uClinux/uClinux-dist/user/iradio/iradio.c:109: undefined reference to `_ts_config'

/home/georg/uclinux/uClinux/uClinux-dist/user/iradio/iradio.c:118: undefined reference to `_ts_read'

collect2: ld gab 1 als Ende-Status zurück

make[3]: *** [iradio] Fehler 1




In my makefile i wrote this:


EXEC = iradio

OBJS = iradio.o fbutils.o font_8x8.o font_8x16.o

LDLIBS = -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/variance.so \

    -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/pthres.so \

    -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/linear.so \

    -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/input.so \

    -L/home/georg/uclinux/uClinux/uClinux-dist/staging/usr/lib/ts/dejitter.so \



all: $(EXEC)


$(EXEC): $(OBJS)

    $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)




I think i dont call the link the right way, can you help me?








2010-02-02 05:07:35     Re: linking against tslib

Georg Greil (AUSTRIA)

Message: 85466   


i've managed to compile my program without any error now.


i just put the libts.so  to the list of my object files.


thanks!  i didn't know that the tslib goes to uclinux-dist/staging/usr/


that helped a lot.


unfortunately my hardware is defective (some short circuit in the power supply) so can't try my compiled image for now.


i will write if it works when i've fixed the problem.




thanks a lot






2010-02-02 12:07:40     Re: linking against tslib

Mike Frysinger (UNITED STATES)

Message: 85473   


-L is not the same thing as -l ... all of those -L options in your LDLIBS makes no sense




2010-02-22 14:58:25     Re: linking against tslib

Georg Greil (AUSTRIA)

Message: 86339   


just tested the image on new hardware and everything seems to work fine, although


my touchscreen values are jumping up and down even after calibration ( 100 pixel difference on same spot on display =240 pixel high) ,but this has nothing to do with linking...


i already thought that my makefile is nonsense but i didnt konw what to do else


now im not using the l options and this things.


thanks for help