2014年8月28日 星期四

cross compile mtdev2tuio for TI DM8134

refer to this article

Building mtdev2tuio needs header files of mtdev and liblo, since these two packages are built and install into directories respectively. We can add -I option to gcc command

arm-none-linux-gnueabi-gcc -I/mnt/hgfs/share/qtuio/liblo/include/ -I/mnt/hgfs/share/qtuio/mtdev-1.1.2/include -c mtdev2tuio.c


and we can find the object file is generated (mtdev2tuio.o).


next, link corresponding libs to generate executable.

mtdev and liblo was made and installed into its directories, so we can use -L to load the path and -l to load the lib

arm-none-linux-gnueabi-ld  -o mtdev2tuio mtdev2tuio.o -L/media/DM8134/targetfs/lib -L/usr/lib/liblo/lib/ -L/usr/local/lib/mtdev/lib/ -lmtdev -llo

and we get



God damn it! I never got so many errors in one make.

No worry. It seems that we lack of some libs (printf, free)

so add -lc to add libc into the link stage

arm-none-linux-gnueabi-ld  -o mtdev2tuio mtdev2tuio.o -L/media/DM8134/targetfs/lib -L/usr/lib/liblo/lib/ -L/usr/local/lib/mtdev/lib/ -lmtdev -llo -lc



again, we get a bunch of error messages.

no worry. Just search Google and it give us a good result as usual

the error message is about lacking libs of gcc, so find something looks like "libgcc" in our building environment


and we found there is a libgcc_s in lib, that is it. add it into our link command

arm-none-linux-gnueabi-ld  -o mtdev2tuio mtdev2tuio.o -L/media/DM8134/targetfs/lib -L/usr/lib/liblo/lib/ -L/usr/local/lib/mtdev/lib/ -lmtdev -llo -lc -lgcc_s

press enter! unfortunately there are still errors while linking.


Search Google and I found it

add -lm to the command

arm-none-linux-gnueabi-ld  -o mtdev2tuio mtdev2tuio.o -L/media/DM8134/targetfs/lib -L/usr/lib/liblo/lib/ -L/usr/local/lib/mtdev/lib/ -lmtdev -llo -lc -lgcc_s -lm


and we can find the binary is generated


There are still 3 warnings while linking.

Leave it tomorrow.

:Q


沒有留言:

張貼留言