ofxKinect example won't compile

First of all, I’m new to OF so please bear with me.

I’m using Code::Blocks (with MinGW) on Windows 7.
I tried both OF 007 and 0062. Any other example seems to build and run just fine.
I followed the installation steps for ofxKinect, but I’m a bit clueless why this won’t work.

When I try to build and run, a lot of files are missing. I tried adding them to the search path in build options and it solves some problems, but still there are lots of errors.

I’m currently stuck on these errors:

  
-------------- Build: Debug in kinectExample ---------------  
  
WARNING: Can't read file's timestamp: C:\openframeworks0062\apps\myProjects\kinectExample\src\ofxKinect\libs\libfreenect\cameras.c  
WARNING: Can't read file's timestamp: C:\openframeworks0062\apps\myProjects\kinectExample\src\ofxKinect\libs\libfreenect\core.c  
WARNING: Can't read file's timestamp: C:\openframeworks0062\apps\myProjects\kinectExample\src\ofxKinect\libs\libfreenect\tilt.c  
WARNING: Can't read file's timestamp: C:\openframeworks0062\apps\myProjects\kinectExample\src\ofxKinect\libs\libfreenect\usb_libusb10.c  
WARNING: Can't read file's timestamp: C:\openframeworks0062\apps\myProjects\kinectExample\src\ofxKinect\src\ofxKinect.cpp  
Linking console executable: bin\kinectExample_debug.exe  
mingw32-g++.exe: obj\Debug\src\ofxKinect\libs\libfreenect\cameras.o: No such file or directory  
mingw32-g++.exe: obj\Debug\src\ofxKinect\libs\libfreenect\core.o: No such file or directory  
mingw32-g++.exe: obj\Debug\src\ofxKinect\libs\libfreenect\tilt.o: No such file or directory  
mingw32-g++.exe: obj\Debug\src\ofxKinect\libs\libfreenect\usb_libusb10.o: No such file or directory  
mingw32-g++.exe: obj\Debug\src\ofxKinect\src\ofxKinect.o: No such file or directory  
mingw32-g++.exe: ..\..\..\addons\ofxOsc\libs\oscpack\lib\linux\liboscpack.a: No such file or directory  
mingw32-g++.exe: ..\..\..\addons\ofxOpenCv\libs\opencv\lib\linux\libcv.a: No such file or directory  
mingw32-g++.exe: ..\..\..\addons\ofxOpenCv\libs\opencv\lib\linux\libcxcore.a: No such file or directory  
Process terminated with status 1 (0 minutes, 0 seconds)  
0 errors, 0 warnings  
  

Is there currently any support for ofxKinect for Windows at the moment? I really don’t know what to do. ???

Edit: problem was solved using OF 0062, see this-post for the solution…

It seems like I got a little further by adding files to the project in CodeBlocks, now there’s only this error that I don’t understand. It’s probably something very simple…

  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:uuid.lib ' unrecognized|  
||Warning: .drectve `-defaultlib:uuid.lib ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `-defaultlib:LIBCMT ' unrecognized|  
||Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized|  
||Warning: .drectve `/DEFAULTLIB:"LIBC" /DEFAULTLIB:"OLDNAMES" ' unrecognized|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_control_transfer@32'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_handle_events@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_cancel_transfer@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_handle_events@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_free_transfer@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_alloc_transfer@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_submit_transfer@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_submit_transfer@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_release_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_release_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_get_device_list@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_get_device_descriptor@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_free_device_list@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_open@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_claim_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_open@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_claim_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_release_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_release_interface@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_close@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_get_device_list@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_get_device_descriptor@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_free_device_list@8'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_exit@4'|  
obj\release\addons\ofxKinect\libs\libfreenect\usb_libusb10.o:usb_libusb10.c|| undefined reference to `libusb_init@4'|  
obj\release\src\testApp.o:testApp.cpp|| undefined reference to `ofxKinectRecorder::newFrame(unsigned short*, unsigned char*)'|  
obj\release\src\testApp.o:testApp.cpp|| undefined reference to `ofxKinect::init(bool, bool, bool)'|  
obj\release\src\testApp.o:testApp.cpp|| undefined reference to `ofxKinectPlayer::drawDepth(float, float, float, float)'|  
||=== Build finished: 33 errors, 17 warnings ===|  

No luck either on my next try: OF 007, experimental branch of ofxKinect and VS2010. The example gives me the following errors:

  
Error	1	error C1083: Cannot open include file: 'GL\glew.h': No such file or directory	c:\openframeworks_vs\libs\openframeworks\utils\ofconstants.h	56	1	kinectExample  
Error	2	error C1083: Cannot open include file: 'GL\glew.h': No such file or directory	c:\openframeworks_vs\libs\openframeworks\utils\ofconstants.h	56	1	kinectExample  
Error	3	error C1083: Cannot open source file: '..\src\ofxKinectRecorder.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	4	error C1083: Cannot open source file: '..\src\ofxKinectPlayer.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	5	error C1083: Cannot open source file: '..\src\ofxKinectCalibration.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	6	error C1083: Cannot open source file: '..\src\ofxKinect.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	7	error C1083: Cannot open source file: '..\..\..\addons\ofxVectorMath\src\ofxQuaternion.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	8	error C1083: Cannot open source file: '..\..\..\addons\ofxVectorMath\src\ofxMatrix4x4.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	9	error C1083: Cannot open source file: '..\..\..\addons\ofxThread\src\ofxThread.cpp': No such file or directory	C:\openframeworks_vs\apps\addonsExamples\kinectExample\c1xx	kinectExample  
Error	10	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
Error	11	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
Error	12	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
Error	13	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
Error	14	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
Error	15	error C1083: Cannot open include file: 'cv.h': No such file or directory	c:\openframeworks_vs\addons\ofxopencv\src\ofxcvconstants.h	5	1	kinectExample  
  

I figured out how to include these files in CodeBlocks, but how do I do this in Visual Studio?

Wow, I finally got it working pretty easily! I’ll post a short tutorial on all the steps I took for others puzzling with these problems.

Setup:

  • Windows 7
  • Visual Studio 2010
  • OpenFrameworks 0062
  • ofxKinect, development branch as of today (August 8, 2011)
  1. Download OF v0062 FAT (I used VS-2010).
  2. Get the ofxKinect (development branch) that includes the Visual Studio example project.
  3. Add ofxKinect to the addons directory and copy the example inside to your apps directory.
  4. Open the solution file in Visual Studio, as soon as you run it you will get some errors stating that cpp files are missing from ofxKinect. You can drag and drop these from the addons/ofxKinect/src directory in Windows explorer into the project tree in Visual Studio (there should already be a ‘addons/ofxKinect’ directory in there). Just exclude the files that gave the errors from the project and drag the new ones in there.
  5. When you run it, it tells you the copyFromExternalPixels method is missing, I just commented this line out in ofxKinect.cpp, it does not seem to be essential for it to work, but I have to check what it really does. I think this is just a version mismatch between ofxKinect and the of library, or I am using an outdated version… but it works :slight_smile:

Hi, just wondering about the steps and tutorial you mentioned. Are those the things you enumerated in your latest post or do you still have more tutorials about setting the whole thing up. I would really love to see them.

Having a hard time figuring out how to get Windows 7 to identify and recognize the Kinect for use. What drivers did you use for the Kinect, links would be great.

Thank you very much.

Thanks for the thread ekeijl!!!
I got the example working, I’ll detail a bit more for linusmotu. By the way I’m using Windows 7 x64 running Visual C++ 2010 Express 32bit for both oF 0.062 (of_preRelease_v0062_vs2010_FAT).

Accoding to this up-to-date (June 2011) source:
http://futuretheater.net/wiki/Kinect-Workshop#Kinect-.2B-OpenFrameworks-Workshop
… there are three drivers, libfreenect, openNI (from the manufactures, Primesense) and the oficial Microsoft ones. For sake of simplicity, just focus on libfreenect. Download it here: https://github.com/OpenKinect/libfreenect . You will also need to download the latest ofxKinect here: https://github.com/ofTheo/ofxKinect

Once you have both, plug in the Kinect to your computer, and install all 3 devices that will popup( their names will be Xbox NUI Audio, Xbox Nui Camera, Xbox NUI Motor ) using the drivers in the libfreenect file you just downloaded ( inside directory libfreenect / platform / windows / inf/…) If your computer automatically installs from microsoft’s own drivers servers, exchange them with the mentioned drivers in the Device Manager.

After that, do exactly what ekeijl says. Once you try to compile you will get an error on copyFromExternalPixels. Comment it out, and it should compile.

=D have fun with the Point Cloud!

As irregular says, you need the libfreenect drivers to work with the ofxKinect example. I might write a more elaborate tutorial if I have time, but in the meanwhile I can try to help ofcourse :slight_smile: Open your device manager (Control Panel → Device Manager), and under ‘Human Interface Devices’ it should say ‘Xbox NUI Camera’ (same for Motor and Audio). Otherwise you need to update the drivers and choose the ‘Browse my computer for drivers’ option.

Just a side note: The ofxOpenNI example (which also uses a depth generator, such as Kinect) conflicts with ofxKinect, because it needs the PrimeSense drivers instead of the libfreenect drivers. If you want to run the OpenNI example:

  • I removed all the previous versions of OpenNI/PrimeSense/NITE software on my system, removed the currently installed Kinect drivers and rebooted.
  • Then I installed the latest unstable versions for OpenNI/middleware/hardware.
  • Download the SensorKinect drivers and install the correct one from the bin directory.
  • I only couldn’t get the correct PrimeSense drivers to work, the trick was this: In the device manager, right click the Xbox NUI devices and select ‘update drivers’ → ‘Browse my computer for driver software’ → ‘Let me pick from a list of device drivers on my computer’. The PrimeSense drivers were on this list as ‘Kinect drivers’ (see image below). When I installed (got a warning about the drivers not being digitally signed, install anyway) they showed up correctly as PrimeSense device and the OpenNI samples worked ;D

Thanks very much irregular and ekeijl. You two are lifesavers. :smiley: