DLL Demonstration Files
These instructions are for creating DLL's for the Microsoft Windows operating system. A link to instructions for creating shared object libraries with Linux/Unix is http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html
To build the DLL library:
Create a Win32 console project (named, say, DLLproject) and specify DLL as the application
type.
Add the source files
SupportRoutines.h
SupportRoutines.cpp
to the project.
Specify __MAKEDLL__ as a preprocessor directive. If you look at SupportRoutines.h you will see that this sets the import/export declaration to be _declspec(dllexport).
Build the project. In the Debug (or Release) folder associated with the MSVC solution containing the DLL project the DLL (.dll) library and import library (.lib) files will
be created. Since the project is named DLLproject, these will have the names DLLproject.dll and DLLprojet.lib.
To test the DLL library: Create a Win32 console project. Add the source file
DLLtest.cpp
and either add DLLproject.lib to your project, or specify the property Linker/Input/Additional Dependencies DLLproject.lib and the location of the DLLproject.lib directory in the property Linker/General/Additional Library Directories.
In order for this project to be built, you will need to set the include path to contain the directory that contains
the header file for the classes in the DLL e.g. the file SupportRoutines.h.
To run the program, you will also have to place the DLL library DynamicLinkTest.dll in a location which the system
can find it. A default search location is the startup directory for executable, so you can place the DLL in that
directory, and the program should run.