I have created a .so file and I want to load this lib for compiling another executable file. There is no error reported during makefile process, but when I run the exe file it complains that my library file couldn’t be found. Following is the makefile I use to generate the exe file. Could anyone help me find out the problem? Thank you!
#you can find this header file under $ROOTSYS/test. Please let me know if you need more information
include Makefile.arch
[quote]but when I run the exe file it complains that my library file couldn’t be found.[/quote]Is the directory in which you library are located contained in the LD_LIBRARY_PATH?
No, it’s not the LD_LIBRARY_PATH directory. But in the makefile I have provided the full path ${MyDir}
Hongtao
[quote=“pcanal”][quote]but when I run the exe file it complains that my library file couldn’t be found.[/quote]Is the directory in which you library are located contained in the LD_LIBRARY_PATH?
Humm … this only tells ld where to find the library during the creation of the library (i.e. instead of using a -L). It does NOT tell the executable where to find the library at run-time. You still need to add the directory to the LD_LIBRARY_PATH and/or use the rpath option.
Thanks, I have added the directory to the LD_LIBRARY_PATH and it works well.
Best Regards,
Hongtao
[quote=“pcanal”]Hi,
Humm … this only tells ld where to find the library during the creation of the library (i.e. instead of using a -L). It does NOT tell the executable where to find the library at run-time. You still need to add the directory to the LD_LIBRARY_PATH and/or use the rpath option.