Professional Documents
Culture Documents
DLL
DLL
Here we present an implementation of a DLL using load-time dynamic linking. In it we develop a DLL
which has all the functions needed to calculate a Fibonacci series recursively and an application
which uses it to show the series in a command prompt.
#ifdef MATHLIBRARY_EXPORTS
#define MATHLIBRARY_API __declspec(dllexport)
#else
#define MATHLIBRARY_API __declspec(dllimport)
#endif
int main()
{
// Initialize a Fibonacci relation sequence.
fibonacci_init(1, 1);
// Write out the sequence values until overflow.
do {
std::cout << fibonacci_index() << ": "
<< fibonacci_current() << std::endl;
} while (fibonacci_next());
// Report count of values written before overflow.
std::cout << fibonacci_index() + 1 <<
" Fibonacci sequence values fit in an " <<
"unsigned 64-bit integer.\nEsta prueba fue hecha por Jorge Daniel
Salcedo Del Pino" << std::endl;
}
For this example we used Visual Studio 2019 and its default C++ compiler
Bibliography
What are Drivers & DLLs? [Byte Size] | Nostalgia Nerd. (2016, October 11). Retrieved from
https://www.youtube.com/watch?v=5vLaqjR7DKI
[TPSC], T. P. (2018, April 26). DLL vs EXE | Windows DLL Hell. Retrieved May 5, 2019, from
https://www.youtube.com/watch?v=HVigruKph74
Dynamic-link library. (2019, April 26). Retrieved May 5, 2019, from
https://en.wikipedia.org/wiki/Dynamic-link_library
What is a DLL? (n.d.). Retrieved May 5, 2019, from https://support.microsoft.com/en-
us/help/815065/what-is-a-dll