c - Use __wrap_malloc in a shared library -


i created shared library in linux calls malloc wrapper __wrap_malloc.

void * __wrap_malloc( size_t size ) {    printf("test\n");    return __real_malloc( size ); } 

then shared library generated successfully.

but when use shared library , build application. linker gives me "undefined" error message,

undefined reference `__wrap_malloc' 

is possible call __wrap_malloc() function in shared library?

please advice.

many thanks.

you not using --wrap option ld correctly. without more information command line using impossible determine going wrong.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -