在Ubuntu上编译Basler Pylon SDK

Compiling Basler Pylon SDK for OpenFrameworks on Ubuntu

本文关键字:Pylon SDK Basler 编译 Ubuntu      更新时间:2023-10-16

我正在尝试使用basler(https://www.baslerweb.com/)摄像头,并在OpenFrameworks上使用一些OpenCV东西。我以前曾使用Point Gray相机(带有" FlyCapture2" SDK),没有太多麻烦。Basler有一些称为Windows,Linux和Mac OS的塔SDK。

我可以毫无问题地编译塔架自己的示例,但是当我#include <pylon/PylonIncludes.h>时,我立即发现编译器问题。我已经适当地修改了我的项目的config.make文件(我认为),因此编译器肯定会找到标题文件,但是我不断遇到与塔库中更深层次的错误有关的错误:

In file included from /usr/include/X11/Xlib.h:44:0,
                 from /usr/include/GL/glx.h:30,
                 from /home/stephen/of_v0.9.8_linux64_release/libs/openFrameworks/utils/ofConstants.h:184,
                 from /home/stephen/of_v0.9.8_linux64_release/libs/openFrameworks/ofMain.h:5,
                 from /home/stephen/of_v0.9.8_linux64_release/apps/myApps/canPointerOsc/src/main.cpp:1:
/opt/pylon5/include/GenApi/Types.h:130:9: error: expected identifier before numeric constant
         None,            //!< name resides in custom namespace

看来"无"在其他地方被定义(成数字常数?)。奇怪的是,在编译自己的样品时,这永远不会发生。关于OpenFrameWorks编译过程(选项传递给G ?)是否有一些可能破坏其自己代码的部分:

//! Defines from which standard namespace a node name comes from
    //! ingroup GenApi_PublicUtilities
    typedef enum _EStandardNameSpace
    {
        None,            //!< name resides in custom namespace
        GEV,             //!< name resides in GigE Vision namespace
        IIDC,            //!< name resides in 1394 IIDC namespace
        CL,              //!< name resides in camera link namespace
        USB,             //!< name resides in USB namespace
        _UndefinedStandardNameSpace  //!< Object is not yet initialized
    } EStandardNameSpace;

有什么想法?

看来通过预处理器有矛盾的定义,可能埋在OpenFrameworks本身或其中包括的依赖项之一中。在包含塔标头文件之前添加以下几行解决了问题:

#undef None
#undef Status

哥德,预处理程序!