Question

i'm experiencing some dificulty in compiling this tutorial from msdn :http://msdn.microsoft.com/en-us/library/windows/desktop/ee207405(v=vs.85).aspx . As mentioned in the title, i'm getting the No such file or directory at compile time even after linking winbio.lib generated using dumpbin and LIB commands in VS 2008, and this is the code :

#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%x\n", 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: %d\n", rejectDetail);
    }
    else
    {
        wprintf_s(L"\n WinBioCaptureSample failed. hr = 0x%x\n", hr);
    }
    goto e_Exit;
}

wprintf_s(L"\n Swipe processed - Unit ID: %d\n", 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;
}
Was it helpful?

Solution

using dumpbin and LIB commands in VS 2008

Surely you are using an old version of the Windows SDK. VS2008 shipped with version 6.0. This api however became only available with Windows 7, released in 2009. You'll need to update your SDK, I recommend version 7.1

OTHER TIPS

Try to download Windows Kits (8.0 or 8.1) - at least that's where i have Winbio.h. It's installed with Visual Studio 2012 but can be downloaded separately.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top