我想把单独两个都能用的程序合到一块去,合上后就出现了问题
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")
"
我照上面做了还是出错,我是菜鸟,希望得到大虾们的指点,谢谢
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")
"
我照上面做了还是出错,我是菜鸟,希望得到大虾们的指点,谢谢
我把#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)
#pragma comment(lib,"syunew6d.lib")
放在StdAfx.h里的最下面而不是最上面
我要是把#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)
使用#include <Windows.h>
要是把#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)
是不是就是在CPP里加入#include "syunew6d.h" ??
我照那做了后还是出来这个TimeClock.exe - 1 error(s), 4 warning(s)错误