Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
a679744a
Commit
a679744a
authored
Aug 19, 2013
by
Laurent Belcour
Browse files
Adding a library opener
parent
709fc8f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
sources/core/plugins_manager.cpp
View file @
a679744a
...
...
@@ -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
...
...
sources/plugins/plugins.pro
View file @
a679744a
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment