LD_LIBRARY_PATH, the shared lib path in linux

前端 未结 2 1987
小蘑菇
小蘑菇 2020-12-12 02:07

I wrote a shared object, say libsd.so, and I put libsd.so and its header file sd.h in ~/lib.

Here is another prog

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-12 02:37

    Without the export your declared LD_LIBRARY_PATH is only valid in the script (.bashrc). With the export it should work, but it is usually not a good idea to set your LD_LIBRARY_PATH like this.

    If you don't want to install your library in the system path (e.g. /usr/lib) you should probably use a script that sets LD_LIBARAY_PATH locally and starts your application.

提交回复
热议问题