我想把单独两个都能用的程序合到一块去,合上后就出现了问题
Linking...
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__FindPort@8
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__SetWritePassword@20
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__SetReadPassword@20
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__GetID@12
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__YReadString@24
TimeClockDlg.obj : error LNK2001: unresolved external symbol __imp__YWriteString@20
Release/TimeClock.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.TimeClock.exe - 7 error(s), 0 warning(s)我就是想把"RegEKeyDlg.h"的东西加到"TimeClockDlg.h"里去,编译时出错了,如上
我看了下别人的关于这个错误的帖子,例如
"在stdafx.h文件中添加   
  #include   <shellapi.h>   
  #pragma   comment(lib,"shell32.lib")   
"
我照上面做了还是出错,我是菜鸟,希望得到大虾们的指点,谢谢

解决方案 »

  1.   

    文件视图中把 FindPort等函数实现的文件 加入到项目中。
      

  2.   

    你需要知道FindPort这些函数是那个库里面的,然后把shell32.lib换成你的库。在你原来有RegEKeyDlg.h那个项目里面应该有该库的名称,方法是查看项目属性的链接输入库有那些。
      

  3.   

    原来有RegEKeyDlg.h那个项目里面有syunew6d.lib 
    我把#include   <shellapi.h>   
    #pragma   comment(lib,"syunew6d.lib")
    放在StdAfx.h里的最上面,然后就又出现了这样的错误:
    Compiling...
    StdAfx.cpp
    C:\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(53) : error C2065: 'HDROP' : undeclared identifier
    C:\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(53) : error C2501: 'DECLARE_HANDLE' : missing storage-class or type specifiers
    C:\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(55) : error C2146: syntax error : missing ';' before identifier 'UINT'
    C:\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(55) : error C2501: 'DECLSPEC_IMPORT' : missing storage-class or type specifiers
    C:\Microsoft Visual Studio\VC98\INCLUDE\shellapi.h(55) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.
    Creating browse info file...
    BSCMAKE: error BK1506 : cannot open file '.\Release\StdAfx.sbr': No such file or directory
    Error executing bscmake.exe.TimeClock.exe - 6 error(s), 0 warning(s)
      

  4.   

    尝试:
    #pragma   comment(lib,"syunew6d.lib")
    放在StdAfx.h里的最下面而不是最上面
      

  5.   

    我要是单把#pragma   comment(lib,"syunew6d.lib")放在最下面的话错误就和上面的一样
    我要是把#include   <shellapi.h>
    #pragma   comment(lib,"syunew6d.lib")两个一起放最下面的话就出来新的错误
    Compiling resources...
    Compiling...
    StdAfx.cpp
    Compiling...
    TimeClock.cpp
    TimeClockDlg.cpp
    C:\Documents and Settings\goodo\桌面\GoodoEastRiver2\TimeClockDlg.cpp(485) : warning C4018: '<' : signed/unsigned mismatch
    C:\Documents and Settings\goodo\桌面\GoodoEastRiver2\TimeClockDlg.cpp(490) : warning C4018: '<' : signed/unsigned mismatch
    C:\Documents and Settings\goodo\桌面\GoodoEastRiver2\TimeClockDlg.cpp(509) : warning C4018: '<' : signed/unsigned mismatch
    C:\Documents and Settings\goodo\桌面\GoodoEastRiver2\TimeClockDlg.cpp(565) : warning C4018: '<' : signed/unsigned mismatch
    Generating Code...
    Linking...
    LINK : fatal error LNK1104: cannot open file "syunew6d.lib"
    Error executing link.exe.
    Creating browse info file...TimeClock.exe - 1 error(s), 4 warning(s)
      

  6.   

    删除#include <Shellapi.h>
    使用#include <Windows.h>
      

  7.   

    都放下面的话错误和刚发的错误一样
    要是把#include <Windows.h>放最上面,#pragma   comment(lib,"syunew6d.lib")放最下面的话就出来这样的错误,都放上面也一样
    Compiling...
    StdAfx.cpp
    C:\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>
    Error executing cl.exe.
    Creating browse info file...
    BSCMAKE: error BK1506 : cannot open file '.\Release\StdAfx.sbr': No such file or directory
    Error executing bscmake.exe.TimeClock.exe - 2 error(s), 0 warning(s)
      

  8.   

    删除 #include <Windows.h>#pragma   comment(lib,"syunew6d.lib")放下面Rebuild All把syunew6d.lib放到CPP相同目录下
      

  9.   

    把syunew6d.lib放到CPP相同目录下
    是不是就是在CPP里加入#include "syunew6d.h" ??
    我照那做了后还是出来这个TimeClock.exe - 1 error(s), 4 warning(s)错误
      

  10.   

    把syunew6d.lib放到CPP相同目录下是指:找到syunew6d.lib文件,复制他,然后到你自己的新项目目录下,粘贴他