Unsolved Integrating Qt and Pylon (Basler camera software)
I believe I have imported the libraries correctly as it auto populates Pylon #include headers files.
I am getting the error message at the bottom of the screen when I try to build the program (using a Grab sample code provided by Basler).
I am new to C++ so I am not sure if this is the correct way to set up the .pro file. Any advice would be extremely helpful.
you can use the search function in this forum, and you will find e.g. https://forum.qt.io/topic/100894/integrating-pylon-into-qt-application
It seems you need MSVC on Windows to use this library.
Thank you. @aha_1980
I created an MSVC kit using the AMD64 compilers and Windows SDK debugger - https://ibb.co/L1K4TKB
This cleared up the earlier errors but I am now getting a linker error message on an OpenCV lib file - https://ibb.co/k9W7JG5
I used the same .pro INCLUDEPATH and LIBS on the MSVC and MinGW kit builds for OpenCV. I ran an OpenCV test code (no Pylon) on the MinGW and it compiled and displayed an image as intended.
Any help would be greatly appreciated.
@colinodowd is OpenCV compiled as MSVC 64 bit too?
I just saw, you are using backslashes as path separator in the .pro file.
Replace them with forward slashes, please. Especially constructs like
\b(Backspace) will lead to surprising results.
Also, make sure the path to the libs is 100% correct.
Same error with all back slahses replaced as forward slashes - https://ibb.co/LR8Ft7p.
I got the lib folder from this OpenCV download link: https://uptobox.com/3ep5xbddl9nn - this worked on the MinGW.
I also tried the libraries from this OpenCV download (seems to be the more standard download): https://sourceforge.net/projects/opencvlibrary/
I am now getting this error: https://ibb.co/MhzLz8p
These are the Basler libs: https://ibb.co/t22TtPp
I tried using both the Win32 and x64 versions in QT.
Not sure what I am missing :/
Please post your
.profile as text. The
LIBSlines are incorrect.
The syntax is:
LIBS += -L/path/to/library -llibrary1 -llibrary2 ...
Edit: Seems you changed that in the meantime, because it was already better in earlier posts...
@aha_1980 - here it is:
CONFIG += c++11
INCLUDEPATH += "C:/Program Files/Basler/pylon 5/Development/include"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/GCBase_MD_VC141_v3_1_Basler_pylon.lib"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/GenApi_MD_VC141_v3_1_Basler_pylon.lib"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/PylonBase_v5_2.lib"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/PylonC.lib"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/PylonGUI_v5_2.lib"
LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32/PylonUtility_v5_2.lib"
INCLUDEPATH += C://Users//colin.odowd//Downloads//opencv//build//include
LIBS += -LC://Users//colin.odowd//Downloads//OpenCV-2.4.9//build-qt//lib
@aha_1980 any thoughts on this?
your file got a bit messed up here. I'll post the relevant part edited like it should work:
INCLUDEPATH += "C:/Program Files/Basler/pylon 5/Development/include" LIBS += -L"C:/Program Files/Basler/pylon 5/Development/lib/Win32" \ -lGCBase_MD_VC141_v3_1_Basler_pylon.lib \ -lGenApi_MD_VC141_v3_1_Basler_pylon.lib \ -lPylonBase_v5_2.lib \ -lPylonC.lib \ -lPylonGUI_v5_2.lib \ -lPylonUtility_v5_2.lib INCLUDEPATH += C:/Users/colin.odowd/Downloads/opencv/build/include LIBS += -LC:/Users/colin.odowd/Downloads/OpenCV-2.4.9/build-qt/lib \ -lopencv_calib3d249d \ -lopencv_contrib249d \ -lopencv_core249d \ -lopencv_features2d249d \ -lopencv_flann249d \ -lopencv_gpu249d \ -lopencv_highgui249d \ -lopencv_imgproc249d \ -lopencv_legacy249d \ -lopencv_ml249d \ -lopencv_nonfree249d \ -lopencv_objdetect249d \ -lopencv_ocl249d \ -lopencv_photo249d \ -lopencv_stitching249d \ -lopencv_superres249d \ -lopencv_ts249d \ -lopencv_video249d \ -lopencv_videostab249d
It seems, the opencv libs are debug versions, which is marked by the trailing
d, like "opencv_ts249d". It may therefore be, that you cannot use them with a release build program.
Do you have libraries without trailing d?
That folder only had libs with 'd' at the end.
Where I downloaded from: https://uptobox.com/3ep5xbddl9nn - this worked on the MinGW.
Ran your refined INCLUDE and LIB in both release and debug mode and got this error message:
Where I downloaded from: https://sourceforge.net/projects/opencvlibrary/
I then tried using a differnet OpenCV folder with a library that did not have a 'd' at the end and got this error message:
Does anyone know what I am doing incorrectly?
@colinodowd one backslash got lost in my snippet, I added it.
And once again: on Windows all libraries have to fit your compiler. You cannot use MSVC libs with MinGW or vice versa. So make sure OpenCV is compatible to what you're using.
why do you have quotation marks around your path's? I'm not sure those are interpreted correctly
oh, I totally missed that! I try to avoid special chars - that includes spaces - in all paths when possible.