Skip to content

MinGW 4.8 compatibility #359

@stepanmracek

Description

@stepanmracek

Hi,
I'm very satisfied freenect user on my Linux box. However, I'm trying to compile my code on Windows using MinGW 4.8 compiler shipped with Qt 5.2.0.

I'm compiling current master branch of libfreenect

The first problem is that in platform/windows/unistd.h is preprocessor 'ifdef' statement that typedefs long as ssize_t. Despite I'm using MinGW SSIZE_T is not defined. My typedef of ssize_t is in _mingw.h with _SSIZE_T_DEFINED. I had to change this:

#ifndef _SSIZE_T_
#define _SSIZE_T_
typedef long ssize_t;
#endif // _SSIZE_T_

to this:

#ifndef _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED
typedef long ssize_t;
#endif // _SSIZE_T_DEFINED

Another problem was in example program glview.c on lines 220, 225, 230 and 236. The compiler gave me errors that I can't assign a bool value to freenect_flag_value. Therefore an explicit conversion is needed, e.g.:

auto_exposure = (freenect_flag_value)!auto_exposure;

The last problem is in regview.c. There is already defined symbol ftime in some included header file. So I had to change the name of ftime to something like my_ftime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions