Reputation: 15521
I use dladdr to get full path to the library:
Dl_info dl_info;
int ret = dladdr((void*)&func, &dl_info);
if (ret)
// use dl_info.dli_fname;
It works fine. However, if I rename the folder with the build (and then run again), dli_fname does not contain full path, only file name of the library. Why is that?
There're other steps except renaming build folder (misc. cmake changes, mostly related to install functionality), but nevertheless the issue appears only after renaming (i.e. the application is run not from the build folder).
Upvotes: 0
Views: 2206
Reputation: 203
dl_info.dli_fname not always contain full path in android ( see here)
This is a workaround in this case: see my answer
Upvotes: 0