libtool
[Top][All Lists]
Advanced

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

Issues with dlopen and compile of modules...


From: Chris Bowlby
Subject: Issues with dlopen and compile of modules...
Date: Thu, 21 Oct 2004 17:00:33 -0300

Hi All,

I've been working on a project for some time now and am working into the system a means of creating dynamic modules that will need to be loaded via dlopen (will use libltdl once I've got my initial testing done - for portability reasons), my sample code is as follows:

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

#include <iostream>

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

  handle = dlopen("libtest/libtest.la", RTLD_NOW);

  if (!handle) {
   cerr << dlerror() << "\n";
   exit(EXIT_FAILURE);
  }

//  test_function = dlsym(handle, "test_fun");

  dlclose(handle);
 }

 There are two issues that I've come up with, during compile time with the:

  test_function = dlsym(handle, "test_fun");

 uncommented it complains about:

test.cxx: In function 'void main(void)':
test.cxx:17: ANSI C++ forbids implicit conversion from 'void *' in assignment

Now, it's been a long while sense I last ran into that issue and I can not remember how to fix it.

The second issue is that dlopen (when I get the system to compile the program by commenting out the dlsym line) complains that libtest/libtest.la is not of the right format, I'm compiling it using:

lib_LTLIBRARIES: libtest.la

libtest_la_SOURCES = test.cxx
libtest_la_LDFLAGS = -module

is there something I'm missing?






reply via email to

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