Skip to content

OpenCV and/or Python wrapper (when using OpenCV) fails to build against opencv 3.4 #553

@AdamWill

Description

@AdamWill

Build of libfreenect against opencv 3.4.1 failed for Fedora. This was the error:

cd /builddir/build/BUILD/libfreenect-ddf092cce09ab4bc97529827a061f1a54a046a17/build/wrappers/python && /usr/bin/cython -3 -o freenect3.c /builddir/build/BUILD/libfreenect-ddf092cce09ab4bc97529827a061f1a54a046a17/wrappers/python/freenect.pyx
make -f OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/build.make OpenNI2-FreenectDriver/CMakeFiles/FreenectDriver.dir/depend
In file included from /usr/include/opencv2/core/types_c.h:59,
                 from /usr/include/opencv2/core/core_c.h:48,
                 from /usr/include/opencv/cv.h:63,
                 from /builddir/build/BUILD/libfreenect-ddf092cce09ab4bc97529827a061f1a54a046a17/wrappers/opencv/libfreenect_cv.h:7,
                 from /builddir/build/BUILD/libfreenect-ddf092cce09ab4bc97529827a061f1a54a046a17/wrappers/opencv/libfreenect_cv.c:3:
/usr/include/opencv2/core/cvdef.h:485:1: error: unknown type name 'namespace'
 namespace cv {
 ^~~~~~~~~
/usr/include/opencv2/core/cvdef.h:485:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 namespace cv {
              ^

Digging into this I found an upstream issue with some discussion of this, where upstream states "OpenCV 3.x doesn't not support C compilation mode officially. There are still legacy C API calls (from OpenCV 1.x) but they should be compiled in C++ compilation mode."

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