我做了DLL,其中有一个导出函数声明如下:
void __stdcall MsgShow(int type);
我想在DLL中以MsgShow的形式导出(不用_MsgShow@4的形式),因此编写DEF文件
MsgShow = _MsgShow@4,当我在另一个工程中定义
extern void __stdcall MsgShow(int type);
引用该DLL时(隐式链接),编译器提示找不到外部符号
_MsgShow@4,这个问题怎么解决呀,谢谢各位答复!

解决方案 »

  1.   

    extern "C" void __stdcall MsgShow(int type);
    另外.def文件里好像只要MsgShow就行了,不用MsgShow = _MsgShow@4的
      

  2.   

    extern "C" void __stdcall MsgShow(int type);
    我是这样声明的,不行呀
      

  3.   

    在.def文件时只要写出你要导出的函数名就可以了!不用这样写:MsgShow = _MsgShow@4;
      

  4.   

    extern "C" void __stdcall MsgShow(int type);
    =======================
    extern "C" __stdcall void MsgShow(int type);def文件中直接:
    MsgShow  @1
      

  5.   

    只有跨语言时才用得到MsgShow = _MsgShow@4;
    具体的请参考<Windows核心编程>p471
      

  6.   

    MsgShow  @1
    MsgShow2  @2//<--指定你的函数导出顺序
      

  7.   

    extern "C" void __stdcall MsgShow(int type);.h,.cpp中都这样还会有问题?
    def文件中直接:
    MsgShow
      

  8.   

    MsgShow  @1 //指定的是函数的顺序位置