当前位置: 技术问答>linux和unix
请问ubuntu上建立桌面快捷方式的问题!
来源: 互联网 发布时间:2016-09-15
本文导语: 我的桌面快捷方式内容如下: [Desktop Entry] Name=CTest Comment=Computer Test Exec=/ctest/ctest Icon=/ctest/ctest.ico Terminal=false Type=Application Categories=Application;Utility; StartupNotify=true 可执行程序是/ctest/ctest,该程序依赖于libplay.so,我把l...
我的桌面快捷方式内容如下:
[Desktop Entry]
Name=CTest
Comment=Computer Test
Exec=/ctest/ctest
Icon=/ctest/ctest.ico
Terminal=false
Type=Application
Categories=Application;Utility;
StartupNotify=true
可执行程序是/ctest/ctest,该程序依赖于libplay.so,我把libplay.so也拷贝到/ctest目录下了,但是我双击桌面上的快捷方式,运行不了我的程序;我直接进入/ctest目录,双击ctest程序,可以正常执行的。请问是怎么回事呢?谢谢。
[Desktop Entry]
Name=CTest
Comment=Computer Test
Exec=/ctest/ctest
Icon=/ctest/ctest.ico
Terminal=false
Type=Application
Categories=Application;Utility;
StartupNotify=true
可执行程序是/ctest/ctest,该程序依赖于libplay.so,我把libplay.so也拷贝到/ctest目录下了,但是我双击桌面上的快捷方式,运行不了我的程序;我直接进入/ctest目录,双击ctest程序,可以正常执行的。请问是怎么回事呢?谢谢。
|
libplay.so放到/usr/lib下.
程序所在目录不是libxxx.so的搜索目录.
程序所在目录不是libxxx.so的搜索目录.
the dynamic linker searches for the library as follows (see ld.so(8) for further
details):
o (ELF only) If the executable file for the calling program contains a DT_RPATH tag,
and does not contain a DT_RUNPATH tag, then the directories listed in the DT_RPATH
tag are searched.
o If, at the time that the program was started, the environment variable
LD_LIBRARY_PATH was defined to contain a colon-separated list of directories, then
these are searched. (As a security measure this variable is ignored for set-user-
ID and set-group-ID programs.)
o (ELF only) If the executable file for the calling program contains a DT_RUNPATH
tag, then the directories listed in that tag are searched.
o The cache file /etc/ld.so.cache (maintained by ldconfig(8)) is checked to see
whether it contains an entry for filename.
o The directories /lib and /usr/lib are searched (in that order).
|
那就解释不了双击可以运行的那种情况。个人认为是Exec有问题。一般一个桌面快捷方式对应只有command设置好了,启动应该就没有问题的。请问你的Ubuntu版本?
|
这个不奇怪,可能装载的时候,把当前目录也作为搜索路径了.
|
同意,可以把libplay.so放桌面上检验下是不是库路径的问题。