Reloading a shared c library after been modified?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reloading a shared c library after been modified?

vonbecmann
hi all,
  i've made a simple shared c library for learning purposes
that i call using nativeboost. Now the problem i'm facing
it's that after i changed the library i have to close and
open the image to get those changes, so the question
is there a way to update the library loaded in the image without
closing and opening the image?

thanks.



--
Bernardo E.C.

Sent from a cheap desktop computer in South America.

Reply | Threaded
Open this post in threaded view
|

Re: Reloading a shared c library after been modified?

Clément Béra
Hello,

this is possible but non trivial.

I think the easiest way is to bind the C functions to manage C libraries: dlopen, dlsym, dlclose, dlerror. Then you can manually open and close the dynamic libs (dlopen, dlclose) and call the function dynamically loaded with dlsym. dlerror is used for error handling (else you don't know why your call failed).

Clement.




2014-10-13 0:49 GMT+02:00 Bernardo Ezequiel Contreras <[hidden email]>:
hi all,
  i've made a simple shared c library for learning purposes
that i call using nativeboost. Now the problem i'm facing
it's that after i changed the library i have to close and
open the image to get those changes, so the question
is there a way to update the library loaded in the image without
closing and opening the image?

thanks.



--
Bernardo E.C.

Sent from a cheap desktop computer in South America.