This is a slightly different question to the other threads on function exporting.

Is there a specific compiler or linker switch to turn export name mangling off? Let me tell you why i ask:

i do all my asm development in the VC enviroment. I zipped up the directory containg all my VC project files and asm files for one particulr app, and sent it to work. I unzipped it, loaded it up, went to compile it, and for every function in the .def file i get this error:

buttons.def : error LNK2001: unresolved external symbol DllEntry
...etc...


This is happening because i have the plain name in the .def file, but the compiler is mangling. As far as i can recall, i have got both my work and home enviroments set up the same, and running the same version of MASM. Here are my linker switches:
/nologo /subsystem:windows /dll /incremental:yes /pdb:"Debug/buttons.pdb" /debug /machine:I386 /def:".\buttons.def" /out:"Debug/buttons.dll" /implib:"Debug/buttons.lib" /pdbtype:sept


And like i said, the VC project file is identical, which should mean it is an enviroment issue. Anyone got any clues? I am ripping my hair out....

Cheers!
Posted on 2002-01-16 20:43:09 by sluggy
Proceed functions with the following:
__declspec(dllexport)
(Look here...)
Posted on 2002-01-16 21:55:59 by bitRAKE
and as far as i know, you can turn name mangling of in the .def file by simply adding NONAME behind the function name.

correct me, if i'm wrong.
at least this works when you export functions as ordinals only.

Regards, Phueghy
Posted on 2002-01-17 07:11:45 by phueghy
you can turn name mangling of in the .def file by simply adding NONAME behind the function name.
Yeah, i tried that, but it didn't work. It's quite bizarre: on one machine it compiles fine with a normal .def file, on the other machine it will compile if i decorate the names in the .def file. And i am using identical files on both machines.

I'm sure there has to be a MASM command/switch that i can use to turn off mangling. Bah, i might just have to put up with decorating the names. Double d'oh :rolleyes:
Posted on 2002-01-17 07:21:05 by sluggy