Winbio.h没有这样的文件或目录错误
Winbio.h No such file or directory error
我在从msdn编译本教程时遇到了一些困难:http://msdn.microsoft.com/en-us/library/windows/desktop/ee207405(v=vs.85).aspx。正如标题中所提到的,即使在VS2008中链接了使用dumpbin和lib命令生成的winbio.lib之后,我在编译时也会得到No这样的文件或目录,这是代码:
#include <iostream>
#include <Windows.h>
#include <Stdio.h>
#include <Conio.h>
#include <Winbio.h>
HRESULT CaptureSample();
int main(int argc, char** argv) {
HRESULT CaptureSample();
return 0;
}
HRESULT CaptureSample()
{
HRESULT hr = S_OK;
WINBIO_SESSION_HANDLE sessionHandle = NULL;
WINBIO_UNIT_ID unitId = 0;
WINBIO_REJECT_DETAIL rejectDetail = 0;
PWINBIO_BIR sample = NULL;
SIZE_T sampleSize = 0;
// Connect to the system pool.
hr = WinBioOpenSession(
WINBIO_TYPE_FINGERPRINT, // Service provider
WINBIO_POOL_SYSTEM, // Pool type
WINBIO_FLAG_RAW, // Access: Capture raw data
NULL, // Array of biometric unit IDs
0, // Count of biometric unit IDs
WINBIO_DB_DEFAULT, // Default database
&sessionHandle // [out] Session handle
);
if (FAILED(hr))
{
wprintf_s(L"n WinBioOpenSession failed. hr = 0x%xn", hr);
goto e_Exit;
}
// Capture a biometric sample.
wprintf_s(L"n Calling WinBioCaptureSample - Swipe sensor...n");
hr = WinBioCaptureSample(
sessionHandle,
WINBIO_NO_PURPOSE_AVAILABLE,
WINBIO_DATA_FLAG_RAW,
&unitId,
&sample,
&sampleSize,
&rejectDetail
);
if (FAILED(hr))
{
if (hr == WINBIO_E_BAD_CAPTURE)
{
wprintf_s(L"n Bad capture; reason: %dn", rejectDetail);
}
else
{
wprintf_s(L"n WinBioCaptureSample failed. hr = 0x%xn", hr);
}
goto e_Exit;
}
wprintf_s(L"n Swipe processed - Unit ID: %dn", unitId);
wprintf_s(L"n Captured %d bytes.n", sampleSize);
e_Exit:
if (sample != NULL)
{
WinBioFree(sample);
sample = NULL;
}
if (sessionHandle != NULL)
{
WinBioCloseSession(sessionHandle);
sessionHandle = NULL;
}
wprintf_s(L"n Press any key to exit...");
_getch();
return hr;
}
在VS2008中使用dumpbin和LIB命令
当然,您使用的是旧版本的Windows SDK。VS2008随6.0版一起提供。然而,这个api只在2009年发布的Windows7中可用。您需要更新您的SDK,我建议使用7.1版
尝试下载Windows工具包(8.0或8.1)-至少我有Winbio.h。它与Visual Studio 2012一起安装,但可以单独下载。
相关文章:
- C++系统找不到指定的文件错误
- C++语法头文件错误
- C++生成文件错误"implicit entry/start for main executable"
- C++/生成文件错误:未定义对"main"的引用
- VS2019:资源文件错误:中性(默认)(未知子语言:0x8)
- C++程序不制作文件(错误)
- 安卓工作室 |CPP 文件错误错误: 位图库中对"AndroidBitmap_unlockPixels"的未定义引用
- "what does ":*** [可执行文件] 错误 1 " mean ?"
- 如何修复使用VScode调试器gcc调试时的"找不到文件"错误
- 在课堂上创建了一个朋友,给出"无输入文件"错误
- Qt .exe文件错误
- c++ 添加具有写入文件错误的文本变量
- 无法转换 .CATPart 文件.错误:输入文件路径似乎包含不支持的字符
- 写入文本文件错误,QT
- C++写入文件错误
- Windows Subsystem for Linux (WSL) 下的间歇性随机"找不到文件"错误
- 犰狳读取MAT文件错误
- 无法求解FullPathForFilename:COCOS2DX中可能缺少文件错误
- C Wininet FTP列出了许多文件错误
- 生成文件错误 - 找不到文件 - *.cpp