hello,
I've trying to learn about DLL's and linking on MSDN and have few questions.
there are talking about explicit and implicit linking.
is that mean implicit == static linkiing and
explicit == dinamyc linking.
some explanation or examples/reference would be nice.
thanks.
EDIT:
are there some standard calls to DLL's cos __declspec looks to me like microsoft specific.
or is it that "standard"?
what are other options which will work on other compilers.
Basically Implicit linking is when you use an import library to resolve the address of the functions exported by the DLL. Explicit Linking is when you use the "LoadLibrary(...)" function to load a DLL and then use "GetProcAdress(...)" to get a pointer to the function you are trying to use.
#pragma once
// MathFuncsDll.h
namespace MathFuncs
{
class MyMathFuncs
{
public:
// Returns a + b
static __declspec(dllexport) double Add(double a, double b);
// Returns a - b
static __declspec(dllexport) double Subtract(double a, double b);
// Returns a * b
static __declspec(dllexport) double Multiply(double a, double b);
// Returns a / b
// Throws DivideByZeroException if b is 0
static __declspec(dllexport) double Divide(double a, double b);
};
}