DIPS.obj : error LNK2001: unresolved external symbol "int __stdcall SetDIPSHook(unsigned long)" (?SetDIPSHook@@YGHK@Z)
..\x86\Debug/22 DIPS.exe : fatal error LNK1120: 1 unresolved externals请问这是怎么回师?哪错了?

解决方案 »

  1.   

    创建一个dll模块后,我用dumpbin倒出其中的函数,显示为 go ,没有问题。。
    可是在可执行模块编译时弹出 unresolved external symbol _go 。。
    可执行模块定义如下://hello.h
    extern "C" __declspec(dllexport) void go();
    // TestHello.cpp : Defines the entry point for the application.
    //#include "windows.h"
    #include "Hello.h"int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {
      go();
    return 0;
    }
      

  2.   

    dll模块定义如下://hello.h
    extern "C" __declspec(dllexport) void go();//hello.cpp
    #include "Hello.h"
    #include "windows.h"extern "C" __declspec(dllexport) void go(){
    MessageBox(NULL,TEXT("JJ"),NULL,MB_OK);
    }//hello.def
    LIBRARY Hello
    EXPORTS 
            go
      

  3.   

    没有把这个函数SetDIPSHook所在的.h和.cpp当前的工程中!!!!
      

  4.   

    对不起,我已将可执行模块中的dllexport改为dllimport了,可是仍然报错:
    TestHello.obj : error LNK2001: unresolved external symbol __imp__go//hello.h
    extern "C" __declspec(dllimport) void go();
    // TestHello.cpp : Defines the entry point for the application.
    //#include "windows.h"
    #include "Hello.h"int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {
      go();
    return 0;
    }
      

  5.   

    你用的静态调用,但是没有加入.lib。你的dll程序生成dll的同时会生成自己的.lib,把它加入到Link里面。