Subject: RE: Removing @N's added to symbol names
From: [email-masked] (Colin Peters)

6 Oct 1998 13:57:35 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "Adam Chlipala" <[email-masked]>
Cc: "GNU-win32" <[email-masked]>

Adam Chlipala <[email-masked]> wrote:

>Is there any way that I can get gcc to not add @<somenumber> to the end
>of symbol names?  A DLL that I am using functions from does not have
>this addition but CygWin32 gcc insists on adding it.  Do I have to make
>an object file converter or what?

I suspect what is happening is that the functions you are using are
prototyped as STDCALL (or WINAPI) in a header file somewhere, but exported
from the DLL with only the plain function name. The way to deal with this
situation is to rebuild the import library using the -k option for dlltool
(to [k]ill the @nn at the end of the function name imported). Internally the
function will still have the @, which is expected for stdcall functions, but
the import in the library will load it using the plain name.

On the other hand, if the error occurs when you are linking with the import
library (with an unresolved external) and not at run time (with some message
about not being able to find exported function blah in library blah.dll)
then it may be that the .def file used to build the import library does not
contain the @ for the function names as it has to, or the functions are
actually not stdcall even though they are being prototyped as such. I would
suspect the former because it can happen if you automatically generate the
..def file from the exports of the DLL. The solution here is to use the -k
option *and* add the @nn given for each function you use in the error
messages from the linker to the .def file before rebuilding the import
library.

Good luck,
Colin.

- Colin Peters - colin at fu.is.saga-u.ac.jp
- http://www.geocities.com/Tokyo/Towers/6162/index.html
- Go not to usenet for counsel, for it will say both
- 'yes' and 'no' and 'try another newsgroup'.

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