errors compiling libfreenect (windows 7)

350 views
Skip to first unread message

Ali H

unread,
Jan 10, 2011, 8:50:15 PM1/10/11
to OpenKinect
Hello all,

I recently, finally got a kinect, but while trying to compile
libfreenect on windows 7, I ran into the errors viewable here:

http://pastebin.com/dingweUJ

I'm pretty sure I followed the instructions quite closely, but
whenever I try to compile the solution, I get the above errors. It
seems to be related to pthreads, and indeed when I remove the
pthreads.h library, the errors collapse into "cannot find pthread.h
errors".

I'm using the libraries, dll etc. from the "pthreads-w32-2-8-0-
release" -- is this the right version?

Has anyone run into similar problems or have an idea as to what I can
do to get past this? CMake seems to generate the libfreenect.sln
without a problem and all the right dependencies

Fwiw, i'm using ms visual studio 2010, the 30 day trial version. And
this error occurs regardless of whether i'm in the master or unstable
branch.

Thanks in advance!

Marcos Slomp

unread,
Jan 10, 2011, 9:00:53 PM1/10/11
to openk...@googlegroups.com
Hello,

Try this implementation of pthreads:

There will be tons of ".lib" in the package.
The safest choice will be to stick with the "pthreadVC2.lib".

bp84

unread,
Jan 11, 2011, 1:27:06 AM1/11/11
to OpenKinect
Hi,

As far as I know, master or unstable shouldn't make a difference at
this point.

2.8.0 is the latest and will work. When you extract pthread, the
prebuilt.2 folder contains an /include folder and a /lib folder and
you must give the path for both headers (.../include) and library.../
lib/pthreadVC2.lib) in cmake. And you put the corresponding
pthreadVC2.dll in /windows/system. It's not important where the
headers and library are as long as you supply the proper path in
cmake. Use the screenshot as reference...

Are you trying to supply the pthread.h as the library file in cmake or
something like that or you just mean that this revolves around the
pthread.h file? (in cmake you don't link directly to the .h file, you
link against the /prebuilt.2/include/ folder.) What did you mean when
you say you "remove" pthread.h?? from cmake? the file?

You're looking at these steps right? : http://openkinect.org/wiki/Getting_Started_Windows#Dependencies

Hope you'll find a solution!

Take care,
bankP

Ali SH

unread,
Jan 11, 2011, 7:11:59 PM1/11/11
to openk...@googlegroups.com, msl...@gmail.com, bank....@gmail.com
Hi guys,

Thanks for the responses. Yes, I followed the directions at:


and my CMake set up followed what is on that page (and in the pic here: http://img254.imageshack.us/img254/6277/26349211.png).  The first time I created the makefile, I had CPP, Fakenect and the other options selected, and tried building in viz studio and failed, but that shouldn't affect subsequent generates and builds, right?

I redownloaded pthreads from the ftp (instead of the exe got the individual files), but as expected that made no difference.

When I use the MSVC version of libusb, I get 78 errors, with a whole bunch of libusb errors. So, in the makefile I'm using MSVCx64 for libusb which gets rid of those errors. Maybe there's an incompatibility between MSVCx64 and pthreads?

I've tried using the pthreadVCE2.lib/dll files, but that still yields the 61 errors :P.

Yes, I'm pointing to the folder not the header file. By removing "pthreads.h", I meant that I temporarily renamed it the file to "_pthreads.h", and tried building the solution in Visual Studio - which is when the 61 errors collapse into the following 5 errors:

Error 7 error C1083: Cannot open include file: 'pthread.h': No such file or directory \libfreenect\wrappers\c_sync\libfreenect_sync.c 27 1 freenect_sync
Error 14 error C1083: Cannot open include file: 'pthread.h': No such file or directory \libfreenect\wrappers\c_sync\libfreenect_sync.c 27 1 freenect_sync_static
Error 23 error C1083: Cannot open include file: 'pthread.h': No such file or directory \libfreenect\examples\glview.c 34 1 glview
Error 24 error LNK1104: cannot open file '..\lib\Debug\freenect_sync.lib' \build\examples\LINK tiltdemo
Error 25 error LNK1104: cannot open file '..\lib\Debug\freenect_sync.lib' \build\examples\LINK glpclview

I'm pretty sure all my dependencies are set up correctly. Which made me think there was something wrong with my pthreads.h file, but now I suspect there might be an incompatibility with the libusb MSVCx64?

Any ideas?

Thanks again :D
Ali
> > Thanks in advance!

--
www.reseed.ca
www.pinkarmy.org

(•`'·.¸(`'·.¸(•)¸.·'´)¸.·'´•) .,.,

Freyr Magnússon

unread,
Jan 12, 2011, 10:39:52 AM1/12/11
to openk...@googlegroups.com
look like you are not including the pthread header files correctly.  Check the project properties to see where its pointing to.  I had to fixup a few include paths and a few lib references before the building the main projects.
Reply all
Reply to author
Forward
0 new messages