Hi all,
I am required to make some changes in an existing long C source code. There is a top-level Makefile which defines the various compiler options like directory locations of libraries used by the linker.
Something like :
LD_OPTIONS = $(PATH_TO_MYLIB1) $(PATH_TO_MYLIB2)
Now, I am thinking of using dlsym()
and dlopen()
to use these libraries instead of linking them explicitly. For this, I need the library path.
dlopen( path_to_lib , RTLD_NOW) ;
How can I use the PATH_TO_LIB
variable from the Makefile and use it in my program? I thought of using something like "echo
with system()
". However, it is my expectation that there are better solutions. :-)