dll linking
how do i "statically" link dll's within my code? I'm wanting to do this so ppl running my programs don't need to find that file.
[disclaimer]
Keep in mind that I am posting this assuming that you are developing for Win32 platform.
[/disclaimer]
you have the actual source code for the project? If so then just make a project that creates a static library and add all the source / header files to it. The process for creating projects will differ depending on which IDE you use (look in the documentation for it)
If you already have a library then I am not sure if that will help you because chances are its the importlib that is just used for linking to the dll. I don't think static libs == importlibs because I'm pretty sure an importlib only contains information about the exported functions/classes for the dll.
Keep in mind that I am posting this assuming that you are developing for Win32 platform.
[/disclaimer]
you have the actual source code for the project? If so then just make a project that creates a static library and add all the source / header files to it. The process for creating projects will differ depending on which IDE you use (look in the documentation for it)
If you already have a library then I am not sure if that will help you because chances are its the importlib that is just used for linking to the dll. I don't think static libs == importlibs because I'm pretty sure an importlib only contains information about the exported functions/classes for the dll.
all i'm trying to do is link a dll to my code. just like i am doing with my lib files:
#pragma comment(lib, filename)
would it just be the same thing with a dll:
// #pragma comment(dll, filename) ?
#pragma comment(lib, filename)
would it just be the same thing with a dll:
// #pragma comment(dll, filename) ?
Quote:Original post by EvilKnuckles666
all i'm trying to do is link a dll to my code. just like i am doing with my lib files:
#pragma comment(lib, filename)
would it just be the same thing with a dll:
// #pragma comment(dll, filename) ?
No, by definition of a DLL. In order to statically link it, you need to recompile a static library, which is easy to do.
see, thing is, i don't have the source for the dll, in fact, it's "d3dx9_26.dll" i'm trying to link.
If you do that, the dll will still need to be present when you run the program.
You could compile the dll into the executable as a resource. You would then need to write it to a file somewhere before calling LoadLibrary on it.
You could compile the dll into the executable as a resource. You would then need to write it to a file somewhere before calling LoadLibrary on it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement