我在程序中用了ShellExecute
一编译就出现
RealAllow.obj : error LNK2001: unresolved external symbol __imp__ShellExecuteA@24
Rel32\RealAllow.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'

解决方案 »

  1.   

    找不到ShellExecute的函数体。请问你是在什么环境下用该函数?MFC?
      

  2.   

    缺少.lib文件。你要在setting里面手工加入shellexecute所属.lib文件。或者用pragma comment加入
      

  3.   

    程序头加
    #pragma comment  (lib,"SHELL32.LIB");
      

  4.   

    偶当初最常遇到的也是这种东西, 后来就知道了. 是缺少库.
    可以 你要在setting里面手工加入shellexecute所属.lib文件。或者用pragma comment加入 DEBUG和RELEASE要分别加.
    #pragma comment (lib,"SHELL32.LIB") 一劳永逸. 之前可以加
    #pragma message( "加载库 SHELL32.LIB" ) 那样编译中还会显示一条信息给你知道.
    最厉害的, 你还可以运行调用你需要的API, 先Load 动态库, 再找到地址, 然后调用. 这是最麻烦的一种了.
      

  5.   

    这样的错误是由于你没有把相应的库文件连接到你的程序中。
    你要在setting里面手工加入shellexecute所属.lib文件。或者用#pragma comment (lib,"XXX.LIB") 在程序中加入.