Receive error when running the CL NUI code
Posted: 24 May 2013 08:00 PM   [ Ignore ]
New Member
Rank
Total Posts:  1
Joined  2013-05-24

Hello, I have installed CL NUI and the sample runs perfectly.
But when I try this code, it gives error :Linker-error-fatal-error-LNK1120-6-unresolved-externals.
I am not sure whether the property page path I created was correct or not as I followed the opencv way in creating a path in MS Visual Studio 2010. This is for my project which is due this week. Any suggestions I will be very much grateful.

// Jim Vaughn
// Displays the color and depth information using OpenCV

#include <opencv/cv.h>
#include <opencv/cxcore.h>
#include <opencv/highgui.h>

#include <CLNUIDevice.h>


using namespace std;

void displayKinectImage();

int main()
{
  displayKinectImage();
}

void displayKinectImage() {
  PDWORD rgb32_data = (PDWORD) malloc(640*480*4);
  PDWORD depth32_data = (PDWORD) malloc(640*480*4);

  CLNUICamera cam = CreateNUICamera(GetNUIDeviceSerial(0));
  CLNUIMotor motor = CreateNUIMotor(GetNUIDeviceSerial(0));

  StartNUICamera(cam);

  cvNamedWindow(“Image”, CV_WINDOW_AUTOSIZE);
  cvNamedWindow(“Depth”, CV_WINDOW_AUTOSIZE);
  cvNamedWindow(“Grey”, CV_WINDOW_AUTOSIZE);

  IplImage *rgb32 = cvCreateImageHeader(cvSize(640, 480), 8, 4);
  IplImage *grey;
  IplImage *depth32 = cvCreateImageHeader(cvSize(640, 480), 8, 4);;

  do {
      GetNUICameraColorFrameRGB32(cam, rgb32_data);
      GetNUICameraDepthFrameRGB32(cam, depth32_data);

      rgb32 = cvCreateImageHeader(cvSize(640,480), 8, 4);
      grey = cvCreateImage(cvSize(640, 480), 8, 1);
      depth32 = cvCreateImageHeader(cvSize(640, 480), 8, 4);

      cvSetData(rgb32, rgb32_data, rgb32->widthStep);
      cvSetData(depth32, depth32_data, depth32->widthStep);

      // Convert RGB32 to greyscale
      cvCvtColor(depth32, grey, CV_RGB2GRAY);

      cvShowImage(“Image”, rgb32);
      cvShowImage(“Grey”, grey);
      cvShowImage(“Depth”, depth32);

      cvReleaseImageHeader(&rgb32;);
      cvReleaseImage(&grey;);
      cvReleaseImageHeader(&depth32;);

      cvWaitKey(1);

  } while (!GetAsyncKeyState(0x50));


  free(rgb32_data);
  free(depth32_data);

  //StopNUICamera(cam);

  //DestroyNUIMotor(motor);

  //DestroyNUICamera(cam);

}

Profile
 
 
 
 


RSS 2.0     Atom Feed