0

I can't figure out why I'm getting this error. I'm guessing it's because I'm not implementing a function.

The Error: Error 2 error LNK2019: unresolved external symbol "private: void __thiscall CGKPRDlg::DisplayError(unsigned long)" (?DisplayError@CGKPRDlg@@AAEXK@Z) referenced in function "public: void __thiscall CGKPRDlg::OnBnClickedDevOpen(void)"

Here is where I call the function:

void CGKPRDlg::OnBnClickedDevOpen()
{

if (!m_hBSP)
    return;

SecuAPI_DEVICE_ID deviceID;

UpdateData(true);

int index = m_deviceList.GetCurSel();
if (index == 0) // Auto detect
    deviceID = SecuAPI_DEVICE_ID_AUTO;
else
    deviceID = g_DeviceIDs[index - 1];

SecuAPI_CloseDevice(m_hBSP, m_DeviceID);

m_DeviceID = deviceID;
SecuAPI_RETURN err = SecuAPI_OpenDevice(m_hBSP, m_DeviceID);

if (err)
    DisplayError(err);                    <---------------------------HERE
else
{
    m_StatusBar = _T("Function success - [Open Device]");

    // Enroll & Verify button enable.
    m_enroll.EnableWindow(TRUE);
    m_verify.EnableWindow(TRUE);

    bool is_autoon_dev = false;
    SecuAPI_DEVICE_ID dev_id = SecuAPI_GetOpenedDeviceID(m_hBSP) & 0x00ff;

    if (m_DeviceID == SecuAPI_DEVICE_ID_AUTO)
        dev_id = SecuAPI_GetOpenedDeviceID(m_hBSP) & 0x00ff;
    else
        dev_id = m_DeviceID & 0x00ff;

    is_autoon_dev = ((dev_id == SecuAPI_DEVICE_NAME_FDU03) || (dev_id == SecuAPI_DEVICE_NAME_FDU04) || (dev_id == SecuAPI_DEVICE_NAME_FDU05)) ?
        true : false;

    m_chkMonitorDevice.EnableWindow(is_autoon_dev);
    m_chkMonitorDevice.SetCheck(BST_UNCHECKED);
}

UpdateData(false);

}

and where I created it in a header file that is included in the cpp file:

private:
    void DisplayError(SecuAPI_RETURN errCode);

I know this is a lot but just trying to give enough to go off of.

EDIT: Here is an included .h file where I guess the define a bunch of functions. I'm guessing it's a lib linking issue now because of this. I'm guessing its' defined in a lib somewhere of theirs that I don't have linked.

SecuAPI_RETURN SecuAPI SecuAPI_EnumerateDevice(SecuAPI_HANDLE hHandle, SecuAPI_UINT32* pNumDevice, SecuAPI_DEVICE_ID** ppDeviceID); SecuAPI_RETURN SecuAPI SecuAPI_OpenDevice (SecuAPI_HANDLE hHandle, SecuAPI_DEVICE_ID nDeviceID); SecuAPI_RETURN SecuAPI SecuAPI_CloseDevice (SecuAPI_HANDLE hHandle, SecuAPI_DEVICE_ID nDeviceID); SecuAPI_RETURN SecuAPI SecuAPI_GetDeviceInfo (SecuAPI_HANDLE hHandle, SecuAPI_DEVICE_ID nDeviceID, SecuAPI_UINT8 nStructureType, SecuAPI_DEVICE_INFO_PTR pDeviceInfo); SecuAPI_RETURN SecuAPI SecuAPI_SetDeviceInfo (SecuAPI_HANDLE hHandle, SecuAPI_DEVICE_ID nDeviceID, SecuAPI_UINT8 nStructureType, SecuAPI_DEVICE_INFO_PTR pDeviceInfo); SecuAPI_RETURN SecuAPI SecuAPI_AdjustDevice (SecuAPI_HANDLE hHandle, const SecuAPI_WINDOW_OPTION_PTR pWindowOption); SecuAPI_DEVICE_ID SecuAPI SecuAPI_GetOpenedDeviceID(SecuAPI_HANDLE hHandle);

user4342836
  • 43
  • 2
  • 10
  • 1
    You've shown us the declaration but not the definition. Either you didn't define the function, or you didn't link with the file that defines it. Perhaps you accidentally defined a different function, if you said `DisplayError` instead of `CGKPRDlg::DisplayError`. – Mike Seymour Mar 09 '15 at 18:13
  • Ahh I bet it's defined in one of these other files/libs I'm linking to. Thanks! – user4342836 Mar 09 '15 at 18:26
  • Possible duplicate: [Unresolved symbols and how to fix them](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Thomas Matthews Mar 09 '15 at 19:17

0 Answers0