From: jeffdb AT netzone DOT com ("Mikey") Subject: Re: NEED HELP: linking an exe with windows lib files 22 Apr 1997 03:54:43 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199704220927.CAA21681.cygnus.gnu-win32@nz1.netzone.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01BC4EC1.EE8CF0C0" X-Mailer: Microsoft Outlook Express 4.71.0544.0 Original-To: "John A. Lewis" Original-Cc: "cygnus" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE Engine V4.71.0544.0 Original-Sender: owner-gnu-win32 AT cygnus DOT com This is a multi-part message in MIME format. ------=_NextPart_000_01BC4EC1.EE8CF0C0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable You have 2 choices that I know of, use MS link32.exe, or build .def = files, and from that make a libname.a type library, enclosed is a script = to make .def files from .lib files, if You, or anyone else who reads = this has a copy of crtdll.lib, or oldnames.lib, please run this script = on it and post the resulting .def file back to the list or to Me ;^). to make the library itself, run dlltool --as=3Das -k --dllname "name".dll --output-lib "name".a --def = "name".def where "name" is the name of the dll you are linking to. #!/bin/sh tlow(){ echo $1|tr A-Z a-z } if [ x"$1" =3D x"" ];then echo "shell script to generate .def files from .LIB files $0 filename ..." exit 0 else for file in $*;do =20 echo LIBRARY `basename $file .LIB` \ > `tlow \`basename $file .LIB\`.def`; \ echo EXPORTS >> `tlow \`basename $file .LIB\`.def`; \ nm --extern-only $file |egrep '^........ [TR]' \ |fgrep -v '\$AA C AT _0 @@' \ |sort \ |sed -e 's/[^_]*_//' \ -e 's/[^?]*?//' \ >> `tlow \`basename $file .LIB\`.def`; done fi # T=3D .text section R=3D readonly .data section (exported variables) # $AA C AT _0 @@ exported structure/internal function definitions (nm's = bust I think ;^) =20 Come on gang...someone must know what to do about this... Help me out here! John A. Lewis wrote: > > I am trying to build an executable which links in some libraries which > are intended for windows. The symbols in these libraries have the _ = in > front of them, which gcc seems to handle, and @4, @8, @12, etc. behind > them, which gcc does not seem to handle. I am kind of a novice here, = so > I have no idea what to do about this. > > Any recommendations on how to fix this? > > Thanks, > --John Lewis ------=_NextPart_000_01BC4EC1.EE8CF0C0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

You have 2 choices that I know of, use = MS=20 link32.exe, or build .def files, and from that make a libname.a type = library,=20 enclosed is a script to make .def files from .lib files, if You, or = anyone else=20 who reads this has a copy of crtdll.lib, or oldnames.lib, please run = this script=20 on it and post the resulting .def file back to the list or to Me = ;^).

to make the library itself, run

dlltool --as=3Das -k --dllname = "name".dll=20 --output-lib "name".a --def "name".def

where "name" is the name of = the dll you=20 are linking to.

#!/bin/sh
 
tlow(){
echo $1|tr A-Z a-z
}
 
if [ x"$1" =3D x"" ];then
echo "shell script to generate .def files from .LIB files
$0 filename ..."
exit 0
else
for file in $*;do
 

echo LIBRARY `basename $file .LIB` = \
> `tlow \`basename $file .LIB\`.def`; \
echo EXPORTS >> `tlow \`basename $file .LIB\`.def`; \
nm --extern-only $file |egrep '^........ [TR]' \
|fgrep -v '\$AA C AT _0 @@' \
|sort \
|sed -e 's/[^_]*_//' \
-e 's/[^?]*?//' \
>> `tlow \`basename $file .LIB\`.def`;
done
fi
 
# T=3D .text section R=3D readonly .data section (exported = variables)
# $AA C AT _0 @@ exported structure/internal function definitions (nm's = bust I=20 think ;^)
 

Come on=20 gang...someone must know what to do about this...  Help me out
here!

John A. Lewis wrote:
>
> I am trying to build an executable which links in some libraries = which
> are intended for windows.  The symbols in these libraries have = the _=20 in
> front of them, which gcc seems to handle, and @4, @8, @12, etc. = behind
> them, which gcc does not seem to handle.  I am kind of a = novice here,=20 so
> I have no idea what to do about this.
>
> Any recommendations on how to fix this?
>
> Thanks,
> --John Lewis

------=_NextPart_000_01BC4EC1.EE8CF0C0-- - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".