Subject: Re: problem building a dll that uses other dll's
From: [email-masked] (Mikey)

30 Aug 1997 03:54:56 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Original-To: [email-masked], [email-masked]
In-Reply-To: <[email-masked]>
X-Mailer: Forte Agent 1.01/32.397
Original-Sender: [email-masked]

The dll is not the stub library, the stub library
for foo.dll is libfoo.a

to use ld.exe directly, you would need to do

ld --subsystem [ windows/console ] --dll -e _dll_entry@12 -o prog.exe prog.o -L/search/dir -lfoo

the -l automatically adds the lib prefix, and the .a suffix. to the stub library name

-L is used to add a search path for ld.

The order of files on the link line IS important, since ld is
a one pass linker, references must be resolved by
object files farther allong in the link line.

BTW all of this stuff is in the ld man page, and also
in gcc.info, you might try reading them.

On Mon, 25 Aug 1997 13:42:04 -500, you wrote:

>> You must tell ld (or link.exe) which libraries to
>> link with.
>
>hmm.. what option are you using to do this?  i tried "-l foo.dll" but it 
>doesn't seem to work:
>
>gnuwin32/H-i386-cygwin32/i386-cygwin32/bin/ld.exe: cannot open
>-lhttpdlw.dll: No such file or directory
>
>maybe i just need a different syntax?  but i think it is expecting a .a 
>library.  do you know how to do this?
>
>> easeist way is to let gcc do it.
>> 
>> to link do
>> 
>> gcc -Wl,--dll,-e,_dll_entry@12 -o prog.exe prog.o
>> 
>> the libraries will automatically be linked in.
>
>i tried this, but without specifying the libraries (since i couldn't 
>figure out the syntax for that), and it did the same thing as before - 
>"undefined reference ...".
>
>thanks!
>
>> >I am trying to build a DLL which has function calls which must be
>> >resolved into existing win32 DLL's.
>> >
>> >I am using b18 on winNT 4.0.  i have MSVC 5.0 available.
>> >
>> >Following the instructions for building a relocatable dll, i get an
>> >output but each of the three ld steps reports all the undefined
>> >references for the functions which are in the existing win32 dll's.  i had
>> >to add the --noinhibit-exec option to ld so that it wouldn't delete the
>> >output dll due to the errors.  if i try to use the result dll, it says it 
>> >is an invalid image...
>
>---------------------------------------------------------
>Dan Goldwater          [email-masked]
>http://fatmac.ee.cornell.edu/~goldwada
>---------------------------------------------------------
>
>
>

([email-masked])
delete REMOVETHIS from the above to reply
         Mikey
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".