How to setup the pylon4Linux V5 related settings in specific IDEs?
The one of the major change in pylon4Linux V5 is that it has got so-called a pkg-config to ensure easy build process. This requires that the approach calling external scripts has to be adapted depends on the IDE that you are using.
I will handle in this solution only eclipse and QT.
The application note “AW00102501000 Building pylon Apps with Eclipse Under Linux” describes the needed setting for Pylon4inux.
This is no more valid for pylon4Linux V5, because Basler does not suggest adding single pylon Libs file in to your project.
So it is suggested to create an Eclipse Project with make file and simply add following lines into the make file.
# Installation directories for pylon
PYLON_ROOT ?= /opt/pylon5
CPPFLAGS += $(shell $(PYLON_ROOT)/bin/pylon-config --cflags) -DUSE_GIGE
LIBS += $(shell $(PYLON_ROOT)/bin/pylon-config --libs-rpath) $(shell $(PYLON_ROOT)/bin/pylon-config --libs)
When you use Qt Creator then simply add
# the environment variable can also be set locally, there for just enable following line.
#PYLON_ROOT = /opt/pylon5
#use from environment
PYLON_ROOT = $$(PYLON_ROOT)
INCLUDEPATH += $$system($$PYLON_ROOT/bin/pylon-config --cflags)
CPPFLAGS += $$system( $$PYLON_ROOT/bin/pylon-config --cflags) -DUSE_GIGE
LIBS += $$system( $$PYLON_ROOT/bin/pylon-config --libs-rpath) $$system( $$PYLON_ROOT/bin/pylon-config --libs)
If it is absolutely necessary to take pylon related settings as mostly accustomed when you were using pylon 2.3 trough pylon4 then you can read out the needed setting by calling our pkg-config script with proper parameters.
In the include dialog add following line. Or follow the attached instruction to extend the environment variable and use it.
Simply add flowing links in the linker dialog.
$(shell /opt/pylon5/bin/pylon-config --libs-rpath ) $(shell /opt/pylon5/bin/pylon-config --libs)
It will display you the needed settings which can also be used.