Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Before being able to call a DLL, one has to create a DLL using g++ first.
To create a DLL using g++, do the following steps:
//--------------------------------------------------------------------------- |
//--------------------------------------------------------------------------- |
The function put in the DLL is called GetAnswerOfLife and will return the value of 42. Note the #ifdef's before and after the function. These are obligatory!
Now the function GetAnswerOfLife must be defined in UnitFunctions.cpp. Upon viewing it, the code looks like below
//--------------------------------------------------------------------------- |
Use the following g++ commands:
g++ -c UnitFunctions.cpp |
This should yield your first DLL.
Perhaps you now want to go to the calling a DLL page using g++.
Or download all source code of this page at once.
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.