none
C++ Kinect SDK: error LNK2019 unresolved external symbol RRS feed

  • Question

  • I'm receiving the message "error: LNK2019" error when I attempt to run a basic C++ Kinect program.  I am running Windows 7 32bit with the Kinect SDK 1.0 and developing in Visual Studio 2010.  The included Skeletal Viewer sample works correctly, so I believe my problem lies in the project configuration.  I tried comparing my project config to the sample's, but I can't find any differences so I thought I'd open this up to the forums.  Is there any missing or incorrect information that I'm not seeing?  Or is there some other configuration I should be checking?

    Thank you in advance.

    #include "stdafx.h"
    #include <iostream>
    #include <windows.h>
    #include <NuiApi.h>
    #include <stdio.h>
    
    -- Include Directories: -- 
    $(VCInstallDir)include;
    $(VCInstallDir)atlmfc\include;
    $(WindowsSdkDir)include;
    $(FrameworkSDKDir)\include;
    $(KINECTSDK10_DIR)\inc;
    
     -- Library Directories --
    $(VCInstallDir)lib;
    $(VCInstallDir)atlmfc\lib;
    $(WindowsSdkDir)lib;
    $(FrameworkSDKDir)\lib;
    $(KINECTSDK10_DIR)\lib\x86;

     These are the specific errors I'm getting:

    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiImageStreamGetNextFrame@12 referenced in function _main
    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiImageStreamOpen@24 referenced in function _main
    1>kinectruntime.obj : error LNK2019: unresolved external symbol __imp__NuiInitialize@4 referenced in function _main

    • Edited by stalemilk Thursday, March 22, 2012 10:26 PM
    Thursday, March 22, 2012 10:25 PM

Answers

  • Is kinect10.lib listed among the libraries in your project's properties, under Linker | Input | Additional Dependencies?

    If not, that is the likely cause for the errors.

    John
    K4W Dev

    • Marked as answer by stalemilk Friday, March 23, 2012 12:01 AM
    Thursday, March 22, 2012 11:48 PM

All replies

  • Is kinect10.lib listed among the libraries in your project's properties, under Linker | Input | Additional Dependencies?

    If not, that is the likely cause for the errors.

    John
    K4W Dev

    • Marked as answer by stalemilk Friday, March 23, 2012 12:01 AM
    Thursday, March 22, 2012 11:48 PM
  • Is kinect10.lib listed among the libraries in your project's properties, under Linker | Input | Additional Dependencies?

    If not, that is the likely cause for the errors.

    John
    K4W Dev

    That was it!  Thank you for the quick response and the clear directions.

    Since I see you're with Microsoft, I'd like to point out this step was missing from the set up instructions that come with the SDK installation.  This guide says to link kinect10.lib by linking $(KINECTSDK10_DIR)\lib\x86;  As we saw here, that's not quite the same thing!

    Programming Guide > Using Visual Studio > To Create an Unmanaged Application > Step #5

    Friday, March 23, 2012 12:11 AM
  • Is kinect10.lib listed among the libraries in your project's properties, under Linker | Input | Additional Dependencies?

    If not, that is the likely cause for the errors.

    John
    K4W Dev


    Thank you as well. I'm using the Kinect SDK v.2.0 with a C++ library project and this helped fix the problem with me as well. I added pathes to "Kinect20.lib" and "Kinect20.Face.lib". After added those under Additional Dependencies, the program compiled with no errors.

    Now I cam move onto reading and using the data from IBodyFrameReader and IFaceFrameReader.
    Thursday, January 8, 2015 3:49 AM
  • thanks , I found the mistake like you , finally found my  Library Directories was wrong 

    at first , i Configured as      C:\Program Files\Microsoft SDKs\Kinect\v1.8\lib\amd64    instead of   

    $(KINECTSDK10_DIR)\inc;
     
    Monday, March 20, 2017 4:08 AM