From: <sg...@us...> - 2003-11-17 18:24:35
|
Update of /cvsroot/libfunutil/libfunutil/toc/tests/c In directory sc8-pr-cvs1:/tmp/cvs-serv32669/toc/tests/c Added Files: check_for_ltdlopen_and_friends.c Log Message: egg --- NEW FILE: check_for_ltdlopen_and_friends.c --- /** Quick check for lt_dlopen(), lt_dlclose() and lt_dlsym(). toc usage: toc_run_fail path/to/this/file -lltdl -export-dynamic */ #include <ltdl.h> #include <stdlib.h> void foo_function() {} int main() { typedef void (*func)(); void * soh = 0; lt_dlinit(); soh = lt_dlopen( 0 ); // , RTLD_NOW | RTLD_GLOBAL ); if( ! soh ) { printf( "could not open main app: %s\n", lt_dlerror() ); return 1; } void * sym = (func) lt_dlsym( soh, "foo_function" ); if( 0 == sym ) { printf( "could not find test symbol: %s\n", lt_dlerror() ); return 2; } return 0; } |