Loadable modules
Maciek Dobrzanski
macko@scifi.pl
Tue Sep 21 17:41:00 GMT 1999
Hi,
I have written simple program that imports functions from external
modules (using dlopen() and dlsyms()). Also I have written simple module
with one function inside that does nothing but printing "It worked".
Now, I don't now how to compile/link/whatever the module, so that it
could be loaded into the program.
gcc -o test.exe test.c
gcc -c -o mod.o mod.c
and then what...???
Executing 'ld -o mod.so mod.o' doesn't work (there is an error because
of undefinied reference to printf()).
program.c:
...
ptr = dlopen ("mod.so", 1);
...
test = (func) dlsym (ptr, "mod_exec");
test();
...
mod.c:
#include <stdio.h>
int mod_exec ()
{
printf ("It worked!\n");
}
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com
More information about the Cygwin
mailing list