Galaxy Galaxy - 1 month ago 12
C++ Question

Fail to link pylon framework in Qt creator on Mac

I'm trying to add the pylon framework to Qt creator on Mac.

QMAKE_LFLAGS += -F/Library/Frameworks/
LIBS += -framework pylon

This doesn't work to me. The error is always
'pylon/PylonIncludes.h' file not found

I can specify the header path for Qt creator, e.g.
INCLUDEPATH += /Library/Frameworks/pylon.framework/Versions/A/Headers
. But it should be
#include <PylonIncludes.h>
, not
#include <pylon/PylonIncludes.h>
when including the head file in code.

However, the API headers all use such form as
#include <pylon/PylonIncludes.h>
, which means I cannot specify the path of header if I want to use the existing API.

Does anyone know how to add pylon framework to Qt creator?


A) If you are compiling this Pylon framework with source then

In these cases you need source code installation, you need to go to your Pylon source directory, e.g.:


You can locate the directory where PylonIncludes.h is installed by runing the following command:

  find <path-to-Pylon> -name PylonIncludes.h

Once you locate the directory e.g. lets say /Users/kevin/Pylon5.5 then you include add the following line in your CMAkeLists.txt

INCLUDEPATH += /Users/kevin/Pylon5.5/src/include/

B) If you have binary framework itself then you can workaround by copying all headers to tmporary location under pylon/<all-headers>

cp -rf /Library/Frameworks/pylon.framework/Versions/A/Headers/* /tmp/pylonHeaders/pylon/

Then use following in .pro file

  INCLUDEPATH += /tmp/pylonHeaders
  LIBS += -framework pylon