Would anyone be so kind as point me to a resource that explains how to make calls to a DLL from a C program? My Google skills have failed. I found many web pages talking about how to CREATE a DLL, but none that explain the minimum code needed in C to access DLL functions. Thanks!

Recommended Answers

All 3 Replies

Sorry for the newb question. I've been browsing around and I learned you need a linker library to use a DLL. So that problem is solved.

Now I just have to figure out how to tell MinGW to look for include files in directories other than it's "include" directory (i.e. "include/notmessy"). Adding the new subdirectory to the Windows PATH doesn't seem to be doing the trick. Grr...

I figured out the MinGW paths as well. The options are -I for include path and -L for lib path. For example

-I C:\MinGW\include -L C:\MinGW\lib

> Adding the new subdirectory to the Windows PATH doesn't seem to be doing the trick
PATH is for executable files (and scripts IIRC)

You need to make use of the -I and -L command line options for gcc
Eg. gcc -I/path/to/headers -L/path/to/lib prog.c If you're using some kind of IDE, then there should be a place in the "project" settings to specify additional paths.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.