\(\newcommand{\W}[1]{ \; #1 \; }\) \(\newcommand{\R}[1]{ {\rm #1} }\) \(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} }\) \(\newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} }\) \(\newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} }\) \(\newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }\)
link_dll_lib¶
View page sourceLink a Dynamic Link Library¶
Syntax¶
include <cppad/utility/link_dll_lib.hpp>
link_dll_lib
dll_linker ( dll_file , err_msg )Prototype¶
link_dll_lib(const std::string& dll_file, std::string& err_msg);
~link_dll_lib(void);
void* operator()
(const std::string& function_name, std::string& err_msg) const;
dll_linker¶
Is the dynamic link object that holds an in memory version of the library,
err_msg¶
If err_msg is non-empty, it contains an error message for the corresponding operation.
dll_file¶
Is the file containing the dynamic link library.
function_name¶
Is the name of an external entry point in the dll.
fun_ptr¶
Is a void*
version of a pointer the function corresponding to
function_name .
Warning !!¶
fun_ptr becomes invalid when the dll_linker destructor is called.
Example¶
The file dll_lib.cpp contains an example and test of
link_dll_lib
.