我是在mfc中使用ReadDirectoryChangesW, 系统是xp。 我的stdafx.h中有#define _WIN32_WINNT 0x0501
我在我的头文件里声明
#pragma comment(lib, "Kernel32.lib")WINBASEAPI
BOOL
WINAPI
ReadDirectoryChangesW(
HANDLE hDirectory,
LPVOID lpBuffer,
DWORD nBufferLength,
BOOL bWatchSubtree,
DWORD dwNotifyFilter,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped,
LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
出现了连接错误,帮我看看是什么原因啊?
error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall ReadDirectoryChangesW(void *,void *,unsigned long,int,unsigned long,unsigned long *,struct _OVERLAPPED *,void (__stdcall*)(unsigned long,unsigned long,struct _OVERLAPPED *))" (__imp_?ReadDirectoryChangesW@@YGHPAX0KHKPAKPAU_OVERLAPPED@@P6GXKK2@Z@Z)
1>D:\test\Release\test.dll : fatal error LNK1120: 1 unresolved externals
解决送上100分,不够再加。
我在我的头文件里声明
#pragma comment(lib, "Kernel32.lib")WINBASEAPI
BOOL
WINAPI
ReadDirectoryChangesW(
HANDLE hDirectory,
LPVOID lpBuffer,
DWORD nBufferLength,
BOOL bWatchSubtree,
DWORD dwNotifyFilter,
LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped,
LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
出现了连接错误,帮我看看是什么原因啊?
error LNK2001: unresolved external symbol "__declspec(dllimport) int __stdcall ReadDirectoryChangesW(void *,void *,unsigned long,int,unsigned long,unsigned long *,struct _OVERLAPPED *,void (__stdcall*)(unsigned long,unsigned long,struct _OVERLAPPED *))" (__imp_?ReadDirectoryChangesW@@YGHPAX0KHKPAKPAU_OVERLAPPED@@P6GXKK2@Z@Z)
1>D:\test\Release\test.dll : fatal error LNK1120: 1 unresolved externals
解决送上100分,不够再加。
并且你可能需要下载最新的SDKhttp://www.microsoft.com/msdownload/platformsdk/sdkupdate