D
Dave
Hi all...
I wrote a simple program to test the dlopen()...\
#include <dlfcn.h>
int main(int argc, char **argv) {
void *handle;
double (*cosine)(double);
char *error;
handle = dlopen ("plugins/test", RTLD_LAZY);
if (!handle) {
fprintf (stderr, "%s\n", dlerror());
exit(1);
}
dlerror(); /* Clear any existing error */
....
I also made a libtest.so in the plugins/test dir.
But the compiler give me the message as follow.
inst.h:21: warning: useless keyword or type name in empty declaration
/tmp/cc2c6Rb1.o(.text+0x27): In function `main':
: undefined reference to `dlopen'
/tmp/cc2c6Rb1.o(.text+0x3e): In function `main':
: undefined reference to `dlerror'
/tmp/cc2c6Rb1.o(.text+0x64): In function `main':
: undefined reference to `dlerror'
/tmp/cc2c6Rb1.o(.text+0x6f): In function `main':
: undefined reference to `dlclose'
collect2: ld returned 1 exit status
what's happened????
I wrote a simple program to test the dlopen()...\
#include <dlfcn.h>
int main(int argc, char **argv) {
void *handle;
double (*cosine)(double);
char *error;
handle = dlopen ("plugins/test", RTLD_LAZY);
if (!handle) {
fprintf (stderr, "%s\n", dlerror());
exit(1);
}
dlerror(); /* Clear any existing error */
....
I also made a libtest.so in the plugins/test dir.
But the compiler give me the message as follow.
inst.h:21: warning: useless keyword or type name in empty declaration
/tmp/cc2c6Rb1.o(.text+0x27): In function `main':
: undefined reference to `dlopen'
/tmp/cc2c6Rb1.o(.text+0x3e): In function `main':
: undefined reference to `dlerror'
/tmp/cc2c6Rb1.o(.text+0x64): In function `main':
: undefined reference to `dlerror'
/tmp/cc2c6Rb1.o(.text+0x6f): In function `main':
: undefined reference to `dlclose'
collect2: ld returned 1 exit status
what's happened????