From: John Keenan on
In a module definition file (.def) the syntax for an export definition is:

EXPORTS
entryname[=internalname] [@ordinal[NONAME]] [DATA] [PRIVATE]

I am using the form:

EXPORTS
entryname = internalname

However I am finding that if entryname is a C++ mangled name (I think that
is the correct term) that the linker is truncating the entry name at the
first @ character that is encountered (and adding a preceeding ?). For
example:

EXPORTS
?myFunc@@YAXABHAAH0PAUinlet@@0PAUplot@@0PAUinletStream@@0PAUoutlet@@ABN66666
AAN66666666666066666@Z = GRATE_mp_MYFUNC

is shown as ??myFunc in Dependency Walker and is properly linked to
GRATE_mp_MYFUNC

Putting quotes around entryname results in "?myFunc appearing in Dependency
Walker and is properly linked to GRATE_mp_MYFUNC

Is there a way to get the linker to recognize entryname with C++ mangled
names?

John


From: Ben Voigt [C++ MVP] on
John Keenan wrote:
> In a module definition file (.def) the syntax for an export
> definition is:
>
> EXPORTS
> entryname[=internalname] [@ordinal[NONAME]] [DATA] [PRIVATE]
>
> I am using the form:
>
> EXPORTS
> entryname = internalname
>
> However I am finding that if entryname is a C++ mangled name (I think
> that is the correct term) that the linker is truncating the entry
> name at the first @ character that is encountered (and adding a
> preceeding ?). For example:
>
> EXPORTS
> ?myFunc@@YAXABHAAH0PAUinlet@@0PAUplot@@0PAUinletStream@@0PAUoutlet@@ABN66666
> AAN66666666666066666@Z = GRATE_mp_MYFUNC
>
> is shown as ??myFunc in Dependency Walker and is properly linked to
> GRATE_mp_MYFUNC
>
> Putting quotes around entryname results in "?myFunc appearing in
> Dependency Walker and is properly linked to GRATE_mp_MYFUNC
>
> Is there a way to get the linker to recognize entryname with C++
> mangled names?

Shouldn't the entryname be the public name, and mangled names would be in
the internalname field?

>
> John


From: Cezary H. Noweta on
Hello,

John Keenan wrote:
> EXPORTS
> ?myFunc@@YAXABHAAH0PAUinlet@@0PAUplot@@0PAUinletStream@@0PAUoutlet@@ABN66666
> AAN66666666666066666@Z = GRATE_mp_MYFUNC
>
> is shown as ??myFunc in Dependency Walker and is properly linked to
> GRATE_mp_MYFUNC
>
> Putting quotes around entryname results in "?myFunc appearing in Dependency
> Walker and is properly linked to GRATE_mp_MYFUNC
>
> Is there a way to get the linker to recognize entryname with C++ mangled
> names?

Probably not. Use librarian (LIB.EXE) to produce export/import libraries
and supply them to the linker in place of .DEF file. If you must use
..DEF file (for example if it contain other linker sections) then you
will have to play with two .DEF files (the one containing the sole
EXPORTS section for LIB and the other without EXPORTS section for LINK).
I do not know what version of tools you are using, but this works fine
for VS 6.0

-- best regards

Cezary Noweta