Win32 C API is working :)

34 views
Skip to first unread message

Milan Kovac

unread,
Nov 14, 2010, 9:30:23 AM11/14/10
to OpenKinect
Hello everybody,

I could manage to get my win32 C API working.

For now you can get that version on my fork, i sent a pull request to
the main repo.

https://github.com/Majorityy/openkinect/tree/win32

Cheers,

Majority

justinmaurer

unread,
Nov 14, 2010, 9:35:52 AM11/14/10
to OpenKinect
Thanks so much!

John Wang

unread,
Nov 15, 2010, 3:40:50 AM11/15/10
to OpenKinect
I'm having trouble compiling the example.

I configure and CMake but when I try to compile, I'm missing a bunch
of libraries such as GL.lib and glu.lib. I can't find them anywhere.

I'm using Windows 7 and Visual Studios 2008.

Joshua Blake

unread,
Nov 15, 2010, 3:50:29 AM11/15/10
to openk...@googlegroups.com
Remove the GL.lib GLU.lib and glut.lib from the linker input and add glut32.lib from http://www.xmission.com/~nate/glut.html
 
Also include libusb.lib from msvc folder of libusb-win32 (driver version) http://sourceforge.net/apps/trac/libusb-win32/wiki
 
 
I just stuck all the depencies in the appropriate include and lib folders in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ (or 9.0 with VS2008) and copied the dlls to C:\windows\system.
 
Hope that helps,
Josh

John Wang

unread,
Nov 15, 2010, 4:43:32 AM11/15/10
to OpenKinect
Ahhh. Awesome. Got it to work with your help and some further
fiddling.

On Nov 15, 12:50 am, Joshua Blake <joshbl...@gmail.com> wrote:
> Remove the GL.lib GLU.lib and glut.lib from the linker input and add
> glut32.lib fromhttp://www.xmission.com/~nate/glut.html
>
> Also include libusb.lib from msvc folder of libusb-win32 (driver version)http://sourceforge.net/apps/trac/libusb-win32/wiki
>
> and pthreadVSE2.lib fromftp://sourceware.org/pub/pthreads-win32/dll-latest
>
> I just stuck all the depencies in the appropriate include and lib folders in
> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ (or 9.0 with VS2008)
> and copied the dlls to C:\windows\system.
>
> Hope that helps,
> Josh
>

Devin Leaman

unread,
Nov 15, 2010, 4:50:45 AM11/15/10
to openk...@googlegroups.com
I managed to get it to compile, now I run it in VS2010 and it gives me a ridiculous amount of errors.  I'm certain I'm doing something simple wrong I'm just not sure what.  I guess I'll keep messing with it till I can figure it out or someone can point me in the correct direction.
--
Sincerely,

Devin Leaman

KakCAT

unread,
Nov 15, 2010, 5:20:05 PM11/15/10
to OpenKinect
I made it work too! :)

w7, vs2008. I had to install python and also had to add a downloaded
stdint.h (I don't know where vs2008 put it)
Had to change some casts too.

On 15 Nov, 10:50, Devin Leaman <dleaman...@gmail.com> wrote:
> I managed to get it to compile, now I run it in VS2010 and it gives me a
> ridiculous amount of errors.  I'm certain I'm doing something simple wrong
> I'm just not sure what.  I guess I'll keep messing with it till I can figure
> it out or someone can point me in the correct direction.
>
>
>
> On Mon, Nov 15, 2010 at 1:43 AM, John Wang <wang.jo...@gmail.com> wrote:
> > Ahhh. Awesome. Got it to work with your help and some further
> > fiddling.
>
> > On Nov 15, 12:50 am, Joshua Blake <joshbl...@gmail.com> wrote:
> > > Remove the GL.lib GLU.lib and glut.lib from the linker input and add
> > > glut32.lib fromhttp://www.xmission.com/~nate/glut.html
>
> > > Also include libusb.lib from msvc folder of libusb-win32 (driver version)

Milan Kovac

unread,
Nov 16, 2010, 11:07:52 AM11/16/10
to OpenKinect
Could you paste the errors you get ? I might help you ;)


On 15 nov, 10:50, Devin Leaman <dleaman...@gmail.com> wrote:
> I managed to get it to compile, now I run it in VS2010 and it gives me a
> ridiculous amount of errors.  I'm certain I'm doing something simple wrong
> I'm just not sure what.  I guess I'll keep messing with it till I can figure
> it out or someone can point me in the correct direction.
>
>
>
> On Mon, Nov 15, 2010 at 1:43 AM, John Wang <wang.jo...@gmail.com> wrote:
> > Ahhh. Awesome. Got it to work with your help and some further
> > fiddling.
>
> > On Nov 15, 12:50 am, Joshua Blake <joshbl...@gmail.com> wrote:
> > > Remove the GL.lib GLU.lib and glut.lib from the linker input and add
> > > glut32.lib fromhttp://www.xmission.com/~nate/glut.html
>
> > > Also include libusb.lib from msvc folder of libusb-win32 (driver version)

johncalgary

unread,
Nov 16, 2010, 1:43:01 PM11/16/10
to OpenKinect
Most of the errors I'm getting are the missing header files, I'm in
the cycle of: compile, google a file name, download, retry.
I haven't used C in a while, but the files seem like they're normally
be part of one distribution.
(time.h, pthreads.h, stdint.h, etc.)

All I've done is download Visual C++ 2008, add to the include dir and
then I've been adding files to the include and lib of the /VC folders.
I'm building using the Visual C++ gui.

It's all info I can get from other resources, but the confusing things
are:
- knowing which branch on github to use. I'm using "win32-merge"
right now:
- knowing where to get the dependencies, I used Joshua's links, but
I'm still not getting a successful compile.

John Wang

unread,
Nov 16, 2010, 1:50:29 PM11/16/10
to OpenKinect
You first have to CMake the c directory.

CMake is a cross compiler program that creates "make files" (in your
case it'll make a VC2008 file).

johncalgary

unread,
Nov 16, 2010, 3:00:06 PM11/16/10
to OpenKinect
Ok, that makes more sense.

I'm getting: "WARNING: you are using the obsolete 'GLU' package,
please use 'OpenGL' instead" now, but that was mentioned in an earlier
post.

Once it's compiling I'll just write up what I did for those that don't
use C.

Robert

unread,
Nov 16, 2010, 5:23:07 PM11/16/10
to OpenKinect
hey guys,

i'm using the win32-merge branch on vs2010 but having trouble
generating the inits.c .. python says : "AttributeError: 'str' object
has no attribute 'decode'" for whatever reason.
it's "Python 3.1.2 (r312:79149, Mar 21 2010, 00:41:52) [MSC v.1500 32
bit (Intel)] on win32"

after a lot of time wasted on google trying to find a solution for
that python problem i just generated it on a ubuntu machine:
this one => http://pastebin.com/Mt0zeNNu

the code compiles and runs but it won't connect to the kinect device
saying the following:
INIT CAMERA
First xfer: -5
CTL CMD 0003 1267 = 12
CTL RES = 0
Bad magic cc cc
CTL CMD 0003 1268 = 12
CTL RES = 20
Bad tag 1267 != 1268
CTL CMD 0003 1269 = 12
CTL RES = 10
CTL CMD 0003 126a = 12
CTL RES = 10
CTL CMD 0003 126b = 12
CTL RES = 0
Bad tag 126a != 126b
CTL CMD 0003 126e = 12
CTL RES = 10
Bad tag 126b != 126e
CTL CMD 0003 126f = 12
CTL RES = 20
Bad tag 126e != 126f
CTL CMD 0003 1270 = 12
CTL RES = 10
CTL CMD 0003 1271 = 12
CTL RES = 10
CTL CMD 0003 1272 = 12
CTL RES = 10
CTL CMD 0003 1273 = 12
CTL RES = 10
CTL CMD 0003 1274 = 12
CTL RES = 10
CTL CMD 0003 1275 = 12
CTL RES = 10
CTL CMD 0003 1276 = 12
CTL RES = 10
CTL CMD 0003 1277 = 12
CTL RES = 10
CTL CMD 0003 1278 = 12
CTL RES = 0
Bad tag 1277 != 1278
CTL CMD 0003 1279 = 12
CTL RES = 10
Bad tag 1278 != 1279
CTL CMD 0003 127a = 12
CTL RES = 20
Bad tag 1279 != 127a
CTL CMD 0003 127b = 12
CTL RES = 10
CTL CMD 0003 127c = 12
CTL RES = 10
CTL CMD 0003 127d = 12
CTL RES = 0
Bad tag 127c != 127d
CTL CMD 0003 127e = 12
CTL RES = 20
Bad tag 127d != 127e
CTL CMD 0003 127f = 12
CTL RES = 10
CTL CMD 0003 1280 = 12
CTL RES = 0
Bad tag 127f != 1280
CTL CMD 0003 1281 = 12
CTL RES = 20
Bad tag 1280 != 1281
CTL CMD 0003 1282 = 12
CTL RES = 10
CTL CMD 0003 1283 = 12
CTL RES = 0
Bad tag 1282 != 1283
CTL CMD 0003 1284 = 12
CTL RES = 20
Bad tag 1283 != 1284

after that, update_isochronous_async() only results in "read 0 bytes"
messages.

any ideas?

On 14 Nov., 15:30, Milan Kovac <milan.kov...@gmail.com> wrote:
> Hello everybody,
>
> I could manage to get mywin32C API working.

EisernSchild

unread,
Nov 17, 2010, 2:31:37 AM11/17/10
to OpenKinect
Hi !

I did throw out the whole python stuff and did manually copy the
"inits.c" file into the lib folder. ( i think this file is built by
python )

In my case ( did a CMake for Visual Studio 9 ) i opened the "\c\build
\lib\freekinect.vcproj" with the wordpad and deleted all entries ( in
<File> section ) for the python stuff...

rickypetit

unread,
Nov 17, 2010, 2:40:33 AM11/17/10
to OpenKinect
Hi,

it works for me on Windows 7, however sometimes the acquisition
freezes. I have tested the acquisition during all night and in the
morning it was going on. However, when I moved the mouse or use the
keyboard (both USB) all my computer freezes and unfreezes erraticly.

Anyway, good work and keep going on!

Milan Kovac

unread,
Nov 17, 2010, 2:37:43 PM11/17/10
to OpenKinect
Hello everybody :

- Getting the software started but with "read 0 bytes" : means there
is no transfer somehow. That is strange because the reason was that he
couldn't find the camera, then you wouldnt even reach that point...I
cannot tell you. You should join IRC and ask ppl there.

- Python problem : you need to install Python 2.6 (the last Python 3.x
doesn't support old stuff).

- Freeze problems when using other USB peripherals : isochronous usb
transfers use a lot of bandwith and with some usb controllers I know
that you can experience such problems if you use the bandwith with
other USB peripherals. By the way, i had that problem on my laptop
when the power adapter was not plugged in. Note that this kind of
problem shouldnt occur and optimization of the driver might help...I
suggest you to go on IRC and ask to ppl.

- For those who have linker problems, let me remind you that you
need : libusb-win32 (driver version, not filter version), pthread for
win32 (use the pthreadVSE2.lib), and glut32 if you use the opengl
sample (we use glut to display the images).

Have fun !

Majority
Reply all
Reply to author
Forward
0 new messages