Commit a679744a authored by Laurent Belcour's avatar Laurent Belcour

Adding a library opener

parent 709fc8f3
......@@ -140,6 +140,35 @@ fitter* plugins_manager::get_fitter()
#endif
}
#ifdef WIN32
#else
#include <stdio.h>
#include <dlfcn.h>
#endif
void* open_library(const std::string& filename, const char* function)
{
#ifdef WIN32
return NULL;
#else
void* handle = dlopen(filename.c_str(), RTLD_LAZY);
if(handle != NULL)
{
void* res = dlsym(handle, function);
if(dlerror() == NULL)
{
std::cerr << "<<ERROR>> unable to load the symbol \"" << function << "\" from " << filename << std::endl;
}
return res;
}
else
{
return NULL;
}
#endif
}
// Get instances of the function, the data and the
// fitter, select one based on the name. Return null
......
TEMPLATE = subdirs
SUBDIRS = \
# rational_fitter_cgal \
rational_fitter_quadprog \
# rational_fitter_parallel \
# rational_fitter_eigen \
# rational_fitter_leastsquare \
# rational_function_chebychev \
# rational_fitter_matlab \
# rational_fitter_dca \
# nonlinear_levenberg_eigen \
# nonlinear_function_phong \
# nonlinear_function_lafortune \
# data_merl \
rational_fitter_cgal \
rational_fitter_quadprog \
rational_fitter_parallel \
rational_fitter_eigen \
rational_fitter_leastsquare \
rational_function_chebychev \
rational_fitter_matlab \
rational_fitter_dca \
nonlinear_levenberg_eigen \
nonlinear_function_phong \
nonlinear_function_lafortune \
data_merl \
# data_astm
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment