[Autogenerated] the other option of linking with the
DLL is known as explicit linking.
Sometimes called dynamic linking,
implicit linking that we've seen in the previous videos is
sometimes also referred to as static linking but we have to be
careful they're not to be confused with starting linking to a
static library which is a different thing.
And so for explicit linking,
the idea here is that we don't want the dealer to be loaded up
front when the executable starts its execution.
We might want to load this dealer later on and this is done
using the load library or load library X.
APIs In this case you don't have to specify just the finance.
You can also specify a full blown path and this will be the
only location to be searched for that DLL and in the case of an
error of the deal is not found or if for whatever reason it's
not properly initialized,
then you get back and not handle the process is not crashing.
It's now your prerogative to handle that error in some meaningful way.
You can crush the process if you want to but
normally you just do something else.
Maybe inform the user.
Maybe you have some kind of fall back.
This is very common for DLS that hold onto resources
that are based on some language.
So resources could be strings, icons, beat maps and so on.
So you might have your application running somewhere in let's say
France and you might want to load the french related DLL that
contains resources that are for France.
If the Dll exists great, you can use it but if it doesn't,
you might want to load a different Dll, maybe one based on english,
which would be your fallback DLL so definitely don't want
to cause that kind of strong dependency,
that resource DLL that may or may not exist and it's not crucial to the
running of the application but it doesn't have to be resources.
You can also use normal dealers in the sense that it might contain code as well.
So in this case you can't just include some header file and
then use or call the function directly.
You can't do that because the linker will again complain
that it doesn't find the function.
You have to retrieve a pointer to the function directly.
Using the function get address which you can call after.
The DLL is explicitly loaded with the load library or load library X functions.
This is only really viable with C functions and we'll see that in a moment,
that's because of that name.
Mangling thing because of that mangling is very difficult to to
attach to C++ functions and even more difficult to attach to C++
functions in C++ classes And so that's something you need to kind
of take into consideration.
There is in fact a way to have your cake and eat it too.
This is known as delay, low DLS.
And the basic idea here is that you specify the DLS at compile time,
so at link time, so to speak.
But there's still loaded dynamically and not statically.
This is something I will not cover,
but it does appear in the in the Microsoft documentation.
So let's see what that looks like when we try to use explicit linking.