User forums > Using Code::Blocks

Linking to DLL's

(1/2) > >>

gregwarner:
Feeling really dumb... How do I link my project to a Windows DLL? (C:\Windows\System32\wiaaut.dll specifically.) I'm at the Linker Settings and I'm trying to add a Link library, but the dialog box only filters file type extensions of .a, .so, .lib, .dylib, and .bundle. How do I choose a DLL?

I have zero experience using Code::Blocks and this is my first time migrating to this IDE.

zabzonk:
You can't link to a DLL directly - you need an import library (a  .LIB file) for it. If you haven't got one, you have to load the functions you want dynamically using LoadLibrary and GetProcAddress. This has nothing specifically to do with Code::Blocks, it's how the Windows linking process works.

gregwarner:
Ah. Thank you for clearing that up.

I don't suppose you know where I could find a good tutorial on how to do that, do you?

stahta01:
FYI:

The answer to your question depends on your Compiler.

NOTE: MinGW GCC can link directly to an DLL.

Tim S.

gregwarner:
I'm using the GNU GCC Compiler.

EDIT: I just read that GCC doesn't directly support Microsoft DLL's, so I just downloaded and installed MinGW.

I'm still a little fuzzy on what I need to do next. I know I need to generate an import library if I don't already have one, but where do I check if there already exists an import library for wiaaut.dll?

Navigation

[0] Message Index

[#] Next page

Go to full version