Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Integrating Pylon into QT Application
QtWS25 Last Chance

Integrating Pylon into QT Application

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
pylonvideo processinimage processin
17 Posts 4 Posters 6.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jgmills
    wrote on 19 Mar 2019, 16:55 last edited by
    #1

    Hi,

    I am trying to use Pylon to record video and display it in my QT GUI and am running into tons of errors.

    I am trying this on my laptop with windows 10 64bit installation.

    In my .pro file, I current have this for the pylon software:
    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"

    In my mainwindow.cpp, I added:
    #include <GenICam.h>

    After adding that include line, my otherwise working GUI is now throwing 892 errors. I included a screenshot of the first 20 or so errors that I am having.

    I already attempted switching the "Win32" directory with the "x64" option just to test it out and it is still returning these errors.

    0_1553014378900_36100e13-0dc1-423f-8975-ec1ecc02b763-image.png

    Any help would be greatly appreciated.

    J 1 Reply Last reply 19 Mar 2019, 17:49
    0
    • J jgmills
      19 Mar 2019, 16:55

      Hi,

      I am trying to use Pylon to record video and display it in my QT GUI and am running into tons of errors.

      I am trying this on my laptop with windows 10 64bit installation.

      In my .pro file, I current have this for the pylon software:
      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"

      In my mainwindow.cpp, I added:
      #include <GenICam.h>

      After adding that include line, my otherwise working GUI is now throwing 892 errors. I included a screenshot of the first 20 or so errors that I am having.

      I already attempted switching the "Win32" directory with the "x64" option just to test it out and it is still returning these errors.

      0_1553014378900_36100e13-0dc1-423f-8975-ec1ecc02b763-image.png

      Any help would be greatly appreciated.

      J Offline
      J Offline
      JonB
      wrote on 19 Mar 2019, 17:49 last edited by JonB
      #2

      @jgmills
      The errors actually seem to be in the Pylon include files rather than the Qt ones.
      I would pick the first error, #error Unknown shared library support in file GCLinkage.h, and look to see why that is being hit.
      You could set up a fresh project to compile with #include <GenICam.h> but no Qt headers/code and just see how that goes.
      It may be that how you are compiling in Qt is not acceptable for Pylon, e.g. C++17 or whatever.
      Do you have any evidence that Pylon compiles OK with what you are using? E.g. is it supposed to be OK with MinGW, or is it MSVC only?
      Do those .lib files look like MSVC, you look like you're MinGW, they are not going to mix? (You're not getting as far as linking, only compiling, but that might be a warning that header files are not going to be compatible too.)
      It looks like you're compiling 64 bit, and Pylon's libs look 64 bit, so that part looks OK to me.

      J 1 Reply Last reply 20 Mar 2019, 13:42
      1
      • J JonB
        19 Mar 2019, 17:49

        @jgmills
        The errors actually seem to be in the Pylon include files rather than the Qt ones.
        I would pick the first error, #error Unknown shared library support in file GCLinkage.h, and look to see why that is being hit.
        You could set up a fresh project to compile with #include <GenICam.h> but no Qt headers/code and just see how that goes.
        It may be that how you are compiling in Qt is not acceptable for Pylon, e.g. C++17 or whatever.
        Do you have any evidence that Pylon compiles OK with what you are using? E.g. is it supposed to be OK with MinGW, or is it MSVC only?
        Do those .lib files look like MSVC, you look like you're MinGW, they are not going to mix? (You're not getting as far as linking, only compiling, but that might be a warning that header files are not going to be compatible too.)
        It looks like you're compiling 64 bit, and Pylon's libs look 64 bit, so that part looks OK to me.

        J Offline
        J Offline
        jgmills
        wrote on 20 Mar 2019, 13:42 last edited by
        #3

        @JonB

        Thanks for getting back to me. Sorry it took so long to respond.

        I tried doing everything in a new QT project and it still had around 50 errors instead of 900.

        Just from looking through the GCLinkage.h file, it looks like it can't determine if I am using a Linux, Apple, or Windows machine. So I assume it could be an issue with using MinGW and not MSVC.

        When I created the QT Project, I have both MinGW and MSVC kits enabled so I do not know how to go around this issue. I am running everything through QT Creator so I do not have Visual Studio installed.

        What would you recommend me doing to resolve this mix-up?

        J 1 Reply Last reply 20 Mar 2019, 13:54
        0
        • J jgmills
          20 Mar 2019, 13:42

          @JonB

          Thanks for getting back to me. Sorry it took so long to respond.

          I tried doing everything in a new QT project and it still had around 50 errors instead of 900.

          Just from looking through the GCLinkage.h file, it looks like it can't determine if I am using a Linux, Apple, or Windows machine. So I assume it could be an issue with using MinGW and not MSVC.

          When I created the QT Project, I have both MinGW and MSVC kits enabled so I do not know how to go around this issue. I am running everything through QT Creator so I do not have Visual Studio installed.

          What would you recommend me doing to resolve this mix-up?

          J Offline
          J Offline
          JonB
          wrote on 20 Mar 2019, 13:54 last edited by JonB
          #4

          @jgmills
          I'm not an expert here --- I don't even use C++ with Qt! :)

          But I'm warning you now: if your Pylon is supplied pre-compiled in .lib files (MSVC) then you are not going to be able to link to those from source compiled with MinGW. You need to use a consistent set of either MSVC or MinGW for all the bits of a single project/executable. So first thing is you need to decide whether you want to be all MSVC or all MinGW. And by the sounds of the errors it might be that the Pylon only really wants to be compiled MSVC not MinGW?

          Others will have to tell you, but I believe you can use MSVC from Qt Creator, you just need to select that everywhere? I do not believe you have to have VS.

          J 1 Reply Last reply 20 Mar 2019, 17:43
          1
          • J JonB
            20 Mar 2019, 13:54

            @jgmills
            I'm not an expert here --- I don't even use C++ with Qt! :)

            But I'm warning you now: if your Pylon is supplied pre-compiled in .lib files (MSVC) then you are not going to be able to link to those from source compiled with MinGW. You need to use a consistent set of either MSVC or MinGW for all the bits of a single project/executable. So first thing is you need to decide whether you want to be all MSVC or all MinGW. And by the sounds of the errors it might be that the Pylon only really wants to be compiled MSVC not MinGW?

            Others will have to tell you, but I believe you can use MSVC from Qt Creator, you just need to select that everywhere? I do not believe you have to have VS.

            J Offline
            J Offline
            jgmills
            wrote on 20 Mar 2019, 17:43 last edited by
            #5

            @JonB

            Ok thank you for helping me.

            I did find some .dll files that did match some of the .lib files that I was using such as:
            LIBS += "C:\Program Files\Basler\pylon 5\Runtime\Win32\GenApi_MD_VC141_v3_1_Basler_pylon.dll"

            Replacing those did not help though. I am going to keep messing around with it to see what is causing the "error Unknown shared library support" error and hope someone might be able to shine some more light on it.

            Thank you!

            J 1 Reply Last reply 20 Mar 2019, 19:18
            0
            • J jgmills
              20 Mar 2019, 17:43

              @JonB

              Ok thank you for helping me.

              I did find some .dll files that did match some of the .lib files that I was using such as:
              LIBS += "C:\Program Files\Basler\pylon 5\Runtime\Win32\GenApi_MD_VC141_v3_1_Basler_pylon.dll"

              Replacing those did not help though. I am going to keep messing around with it to see what is causing the "error Unknown shared library support" error and hope someone might be able to shine some more light on it.

              Thank you!

              J Offline
              J Offline
              JonB
              wrote on 20 Mar 2019, 19:18 last edited by JonB
              #6

              @jgmills
              I wouldn't expect you to get any errors compiling an empty project.

              You wrote earlier:

              When I created the QT Project, I have both MinGW and MSVC kits enabled

              Doesn't it work that you pick one or the other for a project? If you have both kits, how does it fare compiling under the other one from whatever you were using?

              P.S.
              Take a look at https://stackoverflow.com/questions/51394905/how-to-build-pylon-camera-using-mingw-compiler ? And even https://stackoverflow.com/questions/11793370/how-can-i-convert-a-vsts-lib-to-a-mingw-a

              Looks like a rabbit warren. Sounds to me like you'll have more luck with Pylon under Windows if you use MSVC rather than trying with MinGW?

              J 1 Reply Last reply 20 Mar 2019, 20:03
              1
              • J JonB
                20 Mar 2019, 19:18

                @jgmills
                I wouldn't expect you to get any errors compiling an empty project.

                You wrote earlier:

                When I created the QT Project, I have both MinGW and MSVC kits enabled

                Doesn't it work that you pick one or the other for a project? If you have both kits, how does it fare compiling under the other one from whatever you were using?

                P.S.
                Take a look at https://stackoverflow.com/questions/51394905/how-to-build-pylon-camera-using-mingw-compiler ? And even https://stackoverflow.com/questions/11793370/how-can-i-convert-a-vsts-lib-to-a-mingw-a

                Looks like a rabbit warren. Sounds to me like you'll have more luck with Pylon under Windows if you use MSVC rather than trying with MinGW?

                J Offline
                J Offline
                jgmills
                wrote on 20 Mar 2019, 20:03 last edited by
                #7

                @JonB

                I wouldn't expect you to get any errors compiling an empty project.

                Sorry, I meant I added the Pylon library includes and tried to #include <GenICam.h> from an empty project.

                You wrote earlier:

                When I created the QT Project, I have both MinGW and MSVC kits enabled

                Doesn't it work that you pick one or the other for a project? If you have both kits, how does it fare compiling under the other one from whatever you were using?

                I think this may be the issue. I just noticed I have been selecting both MSVC kits and MinGW kits but I do not have a way to compile MSVC so it just defaults to MinGW. I noticed that while trying to select just the MSVC kit, QT Creator later made me select the MinGW Kit. I am going to install a way to compile using MSVC, I assume installing Visual Studio will allow this?

                Thank you again for the help.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 20 Mar 2019, 20:36 last edited by
                  #8

                  Hi,

                  You need either Visual Studio or now you can have only the build tools if you are not interested in VS itself.

                  One other thing you should check is whether you have 32 or 64 bit versions of the Pylon libraries.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  J 1 Reply Last reply 21 Mar 2019, 11:54
                  0
                  • SGaistS SGaist
                    20 Mar 2019, 20:36

                    Hi,

                    You need either Visual Studio or now you can have only the build tools if you are not interested in VS itself.

                    One other thing you should check is whether you have 32 or 64 bit versions of the Pylon libraries.

                    J Offline
                    J Offline
                    jgmills
                    wrote on 21 Mar 2019, 11:54 last edited by
                    #9

                    @SGaist

                    I got Visual Studio and the required packages I believe.

                    One other thing you should check is whether you have 32 or 64 bit versions of the Pylon libraries.

                    When looking through the Development/lib part of pylon, it only lists Win32 or x64 for the Pylon libraries. I assumed x64 was not for Windows but could be wrong there.

                    J 1 Reply Last reply 21 Mar 2019, 12:07
                    0
                    • J jgmills
                      21 Mar 2019, 11:54

                      @SGaist

                      I got Visual Studio and the required packages I believe.

                      One other thing you should check is whether you have 32 or 64 bit versions of the Pylon libraries.

                      When looking through the Development/lib part of pylon, it only lists Win32 or x64 for the Pylon libraries. I assumed x64 was not for Windows but could be wrong there.

                      J Offline
                      J Offline
                      JonB
                      wrote on 21 Mar 2019, 12:07 last edited by
                      #10

                      @jgmills
                      I too could be wrong, but I would have thought that x64 would apply to Windows 64-bit, e.g. https://www.baslerweb.com/en/sales-support/downloads/software-downloads/pylon-5-0-12-windows/

                      Basler pylon 5 supports all current Windows versions up to Windows 10 (32 and 64-bit).

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 21 Mar 2019, 12:31 last edited by
                        #11

                        There are several possible notations:

                        • x86, Win32 are usually for 32bit
                        • x86_64, amd64, x64, Win64 are usually for 64bit

                        I write usually because from time to time you can find 64bit stuff under Win32 because reasons.

                        In any case, I recommend to never assume anything when related to programming and SDK. Naming conventions can be misleading so it's always better to check everything provided.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        1
                        • J Offline
                          J Offline
                          jgmills
                          wrote on 21 Mar 2019, 23:57 last edited by
                          #12

                          @JonB @SGaist

                          I believe you are both correct.

                          I reinstalled QT to come with MSVC capabilities and created a project with the MSVC 2017 64-bit kit. I included all of the necessary packages for pylon and am no longer getting the old errors but I am now getting :-1: error: LNK1104: cannot open file 'GCBase_MDd_VC141_v3_1_Basler_pylon.lib' when I try to compile just an empty project with an #include <GenICam.h>

                          J 1 Reply Last reply 22 Mar 2019, 07:57
                          0
                          • J jgmills
                            21 Mar 2019, 23:57

                            @JonB @SGaist

                            I believe you are both correct.

                            I reinstalled QT to come with MSVC capabilities and created a project with the MSVC 2017 64-bit kit. I included all of the necessary packages for pylon and am no longer getting the old errors but I am now getting :-1: error: LNK1104: cannot open file 'GCBase_MDd_VC141_v3_1_Basler_pylon.lib' when I try to compile just an empty project with an #include <GenICam.h>

                            J Offline
                            J Offline
                            JonB
                            wrote on 22 Mar 2019, 07:57 last edited by JonB
                            #13

                            @jgmills
                            OK, I suspect you are on better lines now that you are opting for MSVC rather than MinGW.

                            GCBase_MDd_VC141_v3_1_Basler_pylon.lib

                            This is a Pylon library. The MDd indicates you are compiling/linking for debug with the MSVC -MD (or /MD) option. That's probably OK, though I have a slight concern: I have never compiled with MSVC for 64-bit, which I think is what you have decided to do, it might be that flag would be for 32-bit. Keep an eye on that when you get further just in case it's an issue.

                            You must now try to find that precise filename in the Pylon area, probably in some kind of libs folder. Go search!

                            • If you find it, as I would expect you to, good! If not, bad :(

                            • Assuming you do find it: you now need to tell you link phase to search the directory it is in for extra libraries. Possibly by having your LIBS variable add that directory to its directories. I don't know how you do that in Qt Creator/.pro file, but there will be a way. Have a look where Creator lets you specify stuff for your chosen compiler kit, there should be something there.

                            J 1 Reply Last reply 22 Mar 2019, 23:05
                            0
                            • J JonB
                              22 Mar 2019, 07:57

                              @jgmills
                              OK, I suspect you are on better lines now that you are opting for MSVC rather than MinGW.

                              GCBase_MDd_VC141_v3_1_Basler_pylon.lib

                              This is a Pylon library. The MDd indicates you are compiling/linking for debug with the MSVC -MD (or /MD) option. That's probably OK, though I have a slight concern: I have never compiled with MSVC for 64-bit, which I think is what you have decided to do, it might be that flag would be for 32-bit. Keep an eye on that when you get further just in case it's an issue.

                              You must now try to find that precise filename in the Pylon area, probably in some kind of libs folder. Go search!

                              • If you find it, as I would expect you to, good! If not, bad :(

                              • Assuming you do find it: you now need to tell you link phase to search the directory it is in for extra libraries. Possibly by having your LIBS variable add that directory to its directories. I don't know how you do that in Qt Creator/.pro file, but there will be a way. Have a look where Creator lets you specify stuff for your chosen compiler kit, there should be something there.

                              J Offline
                              J Offline
                              jgmills
                              wrote on 22 Mar 2019, 23:05 last edited by
                              #14

                              @JonB

                              Sorry for taking so long to get back to you. Yes, now that I am compiling in MSVC things seem to be better, thank you for that.

                              I changed the QT project to compile in Release mode rather than debug and that took care of the issue. That MDd file was not in my directory but the MD was.

                              I am no longer getting these compile errors so I think I am ready to get going.

                              Thank you again for all of your help!

                              J 1 Reply Last reply 23 Mar 2019, 08:52
                              0
                              • J jgmills
                                22 Mar 2019, 23:05

                                @JonB

                                Sorry for taking so long to get back to you. Yes, now that I am compiling in MSVC things seem to be better, thank you for that.

                                I changed the QT project to compile in Release mode rather than debug and that took care of the issue. That MDd file was not in my directory but the MD was.

                                I am no longer getting these compile errors so I think I am ready to get going.

                                Thank you again for all of your help!

                                J Offline
                                J Offline
                                JonB
                                wrote on 23 Mar 2019, 08:52 last edited by
                                #15

                                @jgmills
                                It did not occur to me that they would not have supplied you with the debug version of the library (you sure you downloaded everything they offered?). As you discovered, the d on the end of _MDd_ indicates a library compiled with -MD plus debug (something like -Od -Zi, IIRC). You'll have to keep an eye on what happens when you want to compile your own code with debug, which you're sure to want to do, yet link with Pylon compiled for release. I don't know, you may have problems at runtime where your stuff wants the C/C++ debug libraries/DLLs while Pylon wants the non-debug ones. I don't know whether Pylon gives you their sources so that you can compile those for debug too.

                                1 Reply Last reply
                                0
                                • J Offline
                                  J Offline
                                  jgmills
                                  wrote on 25 Mar 2019, 23:38 last edited by
                                  #16

                                  @JonB

                                  I downloaded straight from their site with the only Pylon option so I don't think anything was installed wrong. I will double check with the installer to see if any setting can be changed.

                                  I don't see how I can switch between release and debug though since I will get errors compiling on debug, I think I will just try to stay in release.

                                  Thank you

                                  L 1 Reply Last reply 15 Feb 2022, 13:32
                                  0
                                  • J jgmills
                                    25 Mar 2019, 23:38

                                    @JonB

                                    I downloaded straight from their site with the only Pylon option so I don't think anything was installed wrong. I will double check with the installer to see if any setting can be changed.

                                    I don't see how I can switch between release and debug though since I will get errors compiling on debug, I think I will just try to stay in release.

                                    Thank you

                                    L Offline
                                    L Offline
                                    lorenzo_aldrighetti
                                    wrote on 15 Feb 2022, 13:32 last edited by
                                    #17

                                    @jgmills Your problem is that you are importing some Pylon headers in the wrong order/missing some include.
                                    Basler suggest importing first the #include <pylon/PylonIncludes.h> and after all the others needed in your headers file.
                                    Checking the latter include you can find a comment:

                                    // PylonPlatform.h must be included before including any GenICam/GenApi header files,
                                    // to ensure that the GENICAM_COMPILER_STR macro used by GenICam/GenApi is set properly
                                    #include <pylon/Platform.h>
                                    #include <pylon/PylonLinkage.h>
                                    

                                    That macro next enables the definition of GENICAM_USER_ALWAYS_LINK_RELEASE. This definition tells the compiler to link the library with the MD specification also in debug mode.
                                    Concluding, to be able to work in debug mode you can choose between:

                                    • In your headers that need some pylon include, add as first the #include <pylon/PylonIncludes.h>
                                    • If you want to avoid all the inclusion made by the latter, in your headers that need some pylon include, add as first the #include <pylon/Platform.h> and the #include <pylon/PylonLinkage.h>
                                    1 Reply Last reply
                                    0

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved