Question

stalemilk on Thu, 22 Mar 2012 22:25:58


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


Sponsored



Replies

John Elsbree [MSFT] on Thu, 22 Mar 2012 23:48:39


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

stalemilk on Fri, 23 Mar 2012 00:11:16


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

derekpicom on Thu, 08 Jan 2015 03:49:21


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.

tanlichun211 on Mon, 20 Mar 2017 04:08:18


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;