Why is name mangling still applied to func3()'s signature. What am I missing? I've reviewed these previously asked questions 1, 2 NO DEF files are being referenced.

// dllmain.cpp
#include "stdafx.h"

extern "C"  __declspec( dllexport ) double __cdecl func1(int id, double t)
{
    return(1.01);
};

extern "C" __declspec( dllexport ) int __cdecl func2(int id)
{
    return(2);
};

extern "C" __declspec( dllexport ) int __cdecl func3(char* file)
{
    return(1);
};

......

Here's output from dumpbin /EXPORTS:

    00000000 characteristics
    51B78F5E time date stamp Tue Jun 11 13:58:06 2013
        0.00 version
           1 ordinal base
           3 number of functions
           3 number of names

    ordinal hint RVA      name

          1    0 00003870 func1 = func1
          2    1 00003880 func2 = func2
          3    2 00001A00 func3 = ?do_encoding@codecvt_base@std@@MEBAHXZ (protected: virtual int __cdecl std::codecvt_base::do_encoding(void)const )
有帮助吗?

解决方案

The exports are not mangled, you can clearly see the unmangled name in the dumpbin.exe output. You also see the mangled name. That's dumpbin.exe being a bit too helpful, perhaps, it also reads the .pdb file to find the actual name of the function. It displays it on the right-hand side of the =

Simply delete the .pdb file and run dumpbin.exe again to see the difference.

You don't have a problem, it worked.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top