zlgopen / awtk-linux-fb

awtk port for linux framebuffer
110 stars 49 forks source link

默认情况下编译系统找不到静态编译的tslib #44

Closed mr-cn closed 4 years ago

mr-cn commented 4 years ago
$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
arm-linux-uclibcgnueabi-gcc -o build/bin/demo1 build/var/awtk/demos/demo1_app.o -L/home/mr/tslib-build/lib -Lbuild/lib -Lbuild/bin -lassets -lts -lawtk_global -lextwidgets -lwidgets -lawtk_linux_fb -lbase -lgpinyin -lstreams -lconf_io -lcompressors -lminiz -lubjson -ltkc -lnanovg-agge -lagge -lnanovg -llinebreak -lstdc++ -lpthread -lrt -lm -ldl
build/lib/libawtk_linux_fb.a(tslib_thread.o): In function `tslib_run':
tslib_thread.c:(.text+0x108): undefined reference to `ts_read'
tslib_thread.c:(.text+0x128): undefined reference to `ts_close'
tslib_thread.c:(.text+0x134): undefined reference to `ts_open'
tslib_thread.c:(.text+0x170): undefined reference to `ts_config'
tslib_thread.c:(.text+0x29c): undefined reference to `ts_close'
build/lib/libawtk_linux_fb.a(tslib_thread.o): In function `tslib_thread_run':
tslib_thread.c:(.text+0x384): undefined reference to `ts_open'
tslib_thread.c:(.text+0x3ac): undefined reference to `ts_config'
tslib_thread.c:(.text+0x424): undefined reference to `ts_close'
collect2: error: ld returned 1 exit status
scons: *** [build/bin/demo1] Error 1
scons: building terminated because of errors.

/home/mr/tslib-build/lib目录下确定有已编译好的libts.a,并且使用反编译软件可以看到该静态库已经正确导出相关函数了。从输出的信息可以看到-L/home/mr/tslib-build/lib-lts都正确的配置好了。请问是这个编译系统不支持静态编译的libts库吗,还是哪里操作有误呢?

xianjimli commented 4 years ago

这个不清楚,我用静态库没有问题。也有人遇到同样的问题,改成动态库就好了。

mr-cn commented 4 years ago

好吧😌

GitYonglin commented 2 years ago

我也遇到一样问题,想问一下您是怎么处理的。 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.

mr-cn commented 2 years ago

@PeachT 我后面使用的动态链接,编译了TSLIB的动态库后就可以正常链接了。你可以先检查一下/home/ylin/AWTK/tslib/build_dir/tslib/lib 目录下有没有正确的二进制库,还要检查他们的ABI是否兼容。