-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
找不到动态库so文件的问题 #21
Comments
编译时找不到库和运行时找不到库时两回事。 运行时找不到,先看bin目录里是否有需要的库(而且是交叉编译的,别把PC版本的拷贝过去里),再看看LD_LIBRARY_PATH是否正确。 |
我明白,编译一直没有问题。控制台用export LD_LIBRARY_PATH指令,执行以后就可以运行程序了。库文件就在bin目录下,跟主程序在同一个目录,加了export才能找到库文件。 我想问的是,如何在编译的时候,就指定程序搜索动态库的目录。类似-Wl,-rpath这样编译器的指令。运行程序就不需要去修改arm-linux的系统环境变量。 |
我也发现在嵌入式平台上mvvm很难部署,究其原因:awtk的awtk_config.py配置文件只支持x86平台,“awtk/tools”目录也没有考虑交叉编译的情况。而最根本的原因应该是官方目前对于mvvm都只是在x86平台上做测试。 |
嵌入式Linux系统用awtk-linux-fb编译,交叉编译配置在awtk-linux-fb/awtk_config.py中。 |
哦,要加编译参数 LINUX_FB=true,之前没留意。 |
编译awtk-mvvm-c-hello,在ubuntu下运行正常
然后交叉编译移植到arm上,编译没有问题。
执行程序时出现如下错误:
root@TinaLinux:/mnt/SDCARD/tttt-mvvm/bin# ./demo
Error loading shared library libtable_view_mvvm.so: No such file or directory (needed by ./demo)
Error loading shared library libslidable_row.so: No such file or directory (needed by ./demo)
Error loading shared library libtable_view.so: No such file or directory (needed by ./demo)
Error loading shared library libui_automation.so: No such file or directory (needed by ./demo)
Error loading shared library libhttpd.so: No such file or directory (needed by ./demo)
Error loading shared library libmvvm.so: No such file or directory (needed by ./demo)
Error loading shared library libawtk.so: No such file or directory (needed by ./demo)
库文件已经放到程序demo的同目录,还放了一份到 tttt-mvvm/lib 里面,都一样。
在Sconscript里面,加入LIBPATH=['#/bin','#/lib'],如下:
env.Program(os.path.join(BIN_DIR, 'demo'), Glob('application.c'), LIBS=['awtk_mvvm_app'] + env['LIBS'],LIBPATH=['#/bin','#/lib']);
依然没用。
在helper里加入add_libpath,也是一样问题。
求教如何在编译时,在程序里加入编译后的动态库搜索目录 (不想因为某个app修改linux环境变量),谢谢
The text was updated successfully, but these errors were encountered: