Linux下编译成功但是运行显示找不到库的办法

(1 ) Find where the library is placed if you don't know it.

sudo find / -name the_name_of_the_file.so
(2) Check for the existence of the dynamic library path environment variable(LD_LIBRARY_PATH)

$ echo $LD_LIBRARY_PATH
if there is nothing to be displayed, add a default path value (or not if you wish to)

$ LD_LIBRARY_PATH=/usr/local/lib
(3) We add the desire path, export it and try the application.

Note that the path should be the directory where the path.so.something is. So if path.so.something is in /my_library/path.so.something it should be :

$ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my_library/
$ export LD_LIBRARY_PATH
$ ./my_app

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,160评论 0 10
  • The Inner Game of Tennis W Timothy Gallwey Jonathan Cape ...
    网事_79a3阅读 14,258评论 3 20
  • 用语言和文字来评论费雯丽这样一个人,是多么的苍白无力,上帝把一个非凡的女子送到人间,在让她经历爱与被爱、幸福...
    罗迪克阅读 2,454评论 0 0
  • 读书的目的:功利心…
    猫悟空阅读 1,105评论 0 1
  • 高考那两天,和平常的日子没有什么不同,就像我们经常性的模考一样,除了我们大家都在食堂复习之外。 我的心早就不静了,...
    二狗和蟑螂阅读 2,675评论 0 1