libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issues with dlopen and compile of modules...


From: Chris Bowlby
Subject: Re: Issues with dlopen and compile of modules...
Date: Tue, 26 Oct 2004 15:13:24 -0300

At 02:34 AM 10/22/2004, Ralf Wildenhues wrote:

Hi All,

Ok, based on the recommendations from Ralf, I've been able to move forward some. I've got her compiling now and the only issue remaining is that the dlopen function is not finding the symbol I need it to look for, the new code looks like:

#include <dlfcn.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>

void main(void) {
 void (*test_function) (int &);
 void *handle =  NULL;

 handle = dlopen("libtest/libtest.so", RTLD_NOW);
 if (!handle) {
  cerr << dlerror() << "\n";
  exit(EXIT_FAILURE);
 }

 test_function = (void (*)(int&))dlsym(handle, "test_fun");
 if (!test_function) {
   cerr << dlerror() << "\n";
   exit(EXIT_FAILURE);
 }

 test_function(1);

 dlclose(handle);
}

When I execute the command I get:

> ./test_call
Undefined symbol "test_fun"

Yet it's defined in the library and compiled in as far as I can tell..

Is there something I need in the library end of things? all it looks like right now is:

#include <iostream>

void test_fun(int &number) {
 cout << number << "\n";
}







reply via email to

[Prev in Thread] Current Thread [Next in Thread]