zlgopen / awtk-linux-fb

awtk port for linux framebuffer
110 stars 49 forks source link

tslib 找不到编译链接库的方法错误(动态 .so)(静态的 .a)都是不行 #92

Open GitYonglin opened 2 years ago

GitYonglin commented 2 years ago

文件都是可以找到的,因为只要lib目录下或者include目录下文件删除都不是下面的错误 https://www.mr-cn.net/2020/07/07/AWTK-GUI-in-Anyka-Arm-Linux/ 我编译了 1.4(https://github.com/libts/tslib/releases/download/1.4/tslib-1.4.tar.gz) 1.22(https://github.com/libts/tslib/releases/download/1.22/tslib-1.22.tar.gz) ./configure --disable-static --enable-shared --enable-input=shared --enable-linear=shared --enable-iir=shared --host=aarch64-linux-gnu --prefix=/home/ylin/AWTK/tslib/build_dir/tslib CC=/usr/bin/aarch64-linux-gnu-gcc CXX=/usr/bin/aarch64-linux-gnu-g++ 两个版本都是以下的错误 交叉编译我用的是树莓派3B, 不编译tslib 是可以运行的 直接在树莓派编译也一样的问题 image

scons: done reading SConscript files. scons: Building targets ... aarch64-linux-gnu-gcc -o bin/demo1 -Wl,-rpath=./bin -Wl,-rpath=./ build/var/awtk/demos/demo1_app.o -L/home/ylin/AWTK/tslib/build_dir/tslib/lib -Llib -Lbin -lassets_old -lts -lawtk_global -lextwidgets -lwidgets -lawtk_linux_fb -lbase -lgpinyin -llinebreak -lfribidi -ldebugger -lfscript_ext -lstreams -lconf_io -lhal -lxml -lcharset -lcsv -lubjson -lcompressors -lminiz -ltkc_core -lmbedtls -lnanovg-agge -lagge -lnanovg -lstdc++ -lpthread -lrt -lm -ldl /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: lib/libawtk_linux_fb.a(tslib_thread.o): in function tslib_run': tslib_thread.c:(.text+0xb0): undefined reference tots_close' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0xbc): undefined reference to ts_open' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0x124): undefined reference tots_read' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0x1ec): undefined reference to ts_close' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0x210): undefined reference tots_config' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: lib/libawtk_linux_fb.a(tslib_thread.o): in function tslib_thread_run': tslib_thread.c:(.text+0x334): undefined reference tots_open' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0x358): undefined reference to ts_config' /usr/lib/gcc-cross/aarch64-linux-gnu/10/../../../../aarch64-linux-gnu/bin/ld: tslib_thread.c:(.text+0x3ac): undefined reference tots_close' collect2: error: ld returned 1 exit status scons: *** [bin/demo1] Error 1 scons: building terminated because of errors.

Originally posted by @PeachT in https://github.com/zlgopen/awtk-linux-fb/issues/44#issuecomment-1148686596

GitYonglin commented 2 years ago

https://github.com/PeachT/tslib_API_TEST 做了一个简单测试,是可以调用到 链接库中的API的 如果有大神知道怎么回事,指点一下,给点思路非常感谢!

fatalfeel commented 2 years ago

做 ./configure前 先export ex: export PATH=$PATH:/opt/ivot/aarch64-ca53-linux-gnueabihf-8.4.01/bin export LD_LIBRARY_PATH=/opt/ivot/aarch64-ca53-linux-gnueabihf-8.4.01/lib 再做 ./configure and make

另外 c and cpp link 時需加入 extern "C" { void C_function(); }