From: Mumit K. <khan@NanoTech.Wisc.EDU> - 2001-06-29 00:52:07
|
On Thu, 28 Jun 2001, Rob Light wrote: > Here's my question: How do I get the linker to output a Win32 EXE which > dynamically links at run-time (under Windows) with a third party Win32 > DLL? Typical first step is to create an import library. Note that GNU linker is smart enough to directly link with the DLL, so you can just specify the DLL file directly on the command line. I'm more used to using an import library, so don't really know what the caveats are in linking directly to a DLL. MSVC as far as I know can't do that, and you have to have an import library. Of course, I'm assuming that the 3rd party DLL is not C++, in which case it simply won't work. > The linker is complaining about undefined references which are located > in the third party Win32 DLL. Here are the commands: > > i386-mingw32msvc-gcc -c -I/home/rlight/test/include -o test.o test.cpp > i386-mingw32msvc-gcc -c -I/home/rlight/test/include -o testmain.o > testmain.cpp > i386-mingw32msvc-gcc -mwindows -o test.exe test.o testmain.o Add the DLL at the end of the command line. Mumit |