I need to include Security32.dll
windows library into my project. Of course, I can load this library dynamically with LoadLibrary function, but is it possible to link the library during linking? I mean something like this (The following example is not correct, I just tried that and provide it as an example):
g++ -o bin main.o -lsecurity.dll
I really depends on your actual linker.
The GCC toolchain provided as part of the MinGW project will allow you to use dynamic link libraries (dll files) directly under Windows rather than static libraries only (or MSVC's lib files), but you'll still need the proper header files so the compiler knows what to call.
Microsoft Visual C++ on the other hand won't support this and will always need static libraries (lib files) with the proper information, even when you're linking against a dynamic/shared library.