This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How do I link a .DLL into my C program on Win32?


Hi!

I'm just getting started with using the GCC compiler, and I have to use 
functions that I don't have the source code for. I've been given a .DLL and 
a .H file.

I am using the most recent version of the Cygwin GCC compiler on a 
Windows2000 platform.

First I tried:

gcc -I. hello.c

and I got:

$ gcc -I. hello.c
/cygdrive/c/DOCUME~1/fdent/LOCALS~1/Temp/ccHKaOcA.o(.text+0xdf):hello.c: 
undefined reference to `PSMsgConnect'

So then I tried:

gcc -I. -l./psmsg.dll hello.c

$ gcc -I. -l./psmsg.dll hello.c
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/../../../../i686-pc-cygwin/bin/ld: 
cannot find -l./psmsg.dll
collect2: ld returned 1 exit status

And the DLL exists in the current directory.

I know that somehow I've got to tell GCC about the existence of the stuff 
inside .DLL ... How do I do that?

Please reply directly to this email address as I am not subscribed to the 
list.

Thanks!

Chris
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]