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. Pylon in Qt compilation issues
QtWS25 Last Chance

Pylon in Qt compilation issues

Scheduled Pinned Locked Moved Solved 3rd Party Software
11 Posts 4 Posters 3.0k 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.
  • H Offline
    H Offline
    hodahle
    wrote on 15 Oct 2019, 12:03 last edited by
    #1

    Hello,

    I have a project where I'm trying to get my Basler cameras to work in Qt. Qt's own QCamera does not recognise these cameras. Basler has their own Pylon module, but that one has been absolutely terrible to get working.

    The problem is as follows:

    • I would prefer to use MinGW, but Basler's Pylon module does not support this. I've tried messing around with other things, even tried building OpenCV from source to be compatible with MinGW and get it to work, but I haven't had any luck. If anyone knows how to skip any MSVC nonsense, that would be the best solution.

    • I've also tried downloading Visual Studio to get a compiler compatible with Pylon. The problem with that is, Microsoft broke that library in VS2019 when they updated some of their macro expansion stuff. Not even the example files included in Pylon work from Visual Studio alone, even without Qt.

    • I then tried downloading the compiler for VS2017 (MSVC v141) through my copy of Visual Studio Community 2019, but Qt doesn't seem to recognise that compiler and I couldn't get it to work.

    • I then tried uninstalling VS entirely and reinstalling it with only MSVC v141, but Qt now doesn't recognise any MSVC compiler at all.

    It seems to me that Qt doesn't play nice with VS2019 in the first place, but figuring out how to get a working copy of VS2017 has been quite the challenge. Microsoft seems to want you to pay in order to get an actual copy of VS2017, which I would prefer not to do, but just the compiler from the newer version doesn't work either. Any help would be greatly appreciated.

    Sample of errors I get trying to compile:
    issues.PNG

    Relevant parts of .pro file:

    INCLUDEPATH += "C:\Basler\pylon6\Development\include"
    
    LIBS += "C:/Basler/pylon6/Development/lib/x64/GCBase_MD_VC141_v3_1_Basler_pylon.lib"
    LIBS +="C:/Basler/pylon6/Development/lib/x64/GenApi_MD_VC141_v3_1_Basler_pylon.lib"
    LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonBase_v6_0.lib"
    LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonC.lib"
    LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonGUI_v6_0.lib"
    LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonUtility_v6_0.lib"
    
    J 1 Reply Last reply 15 Oct 2019, 12:18
    0
    • H hodahle
      15 Oct 2019, 12:03

      Hello,

      I have a project where I'm trying to get my Basler cameras to work in Qt. Qt's own QCamera does not recognise these cameras. Basler has their own Pylon module, but that one has been absolutely terrible to get working.

      The problem is as follows:

      • I would prefer to use MinGW, but Basler's Pylon module does not support this. I've tried messing around with other things, even tried building OpenCV from source to be compatible with MinGW and get it to work, but I haven't had any luck. If anyone knows how to skip any MSVC nonsense, that would be the best solution.

      • I've also tried downloading Visual Studio to get a compiler compatible with Pylon. The problem with that is, Microsoft broke that library in VS2019 when they updated some of their macro expansion stuff. Not even the example files included in Pylon work from Visual Studio alone, even without Qt.

      • I then tried downloading the compiler for VS2017 (MSVC v141) through my copy of Visual Studio Community 2019, but Qt doesn't seem to recognise that compiler and I couldn't get it to work.

      • I then tried uninstalling VS entirely and reinstalling it with only MSVC v141, but Qt now doesn't recognise any MSVC compiler at all.

      It seems to me that Qt doesn't play nice with VS2019 in the first place, but figuring out how to get a working copy of VS2017 has been quite the challenge. Microsoft seems to want you to pay in order to get an actual copy of VS2017, which I would prefer not to do, but just the compiler from the newer version doesn't work either. Any help would be greatly appreciated.

      Sample of errors I get trying to compile:
      issues.PNG

      Relevant parts of .pro file:

      INCLUDEPATH += "C:\Basler\pylon6\Development\include"
      
      LIBS += "C:/Basler/pylon6/Development/lib/x64/GCBase_MD_VC141_v3_1_Basler_pylon.lib"
      LIBS +="C:/Basler/pylon6/Development/lib/x64/GenApi_MD_VC141_v3_1_Basler_pylon.lib"
      LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonBase_v6_0.lib"
      LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonC.lib"
      LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonGUI_v6_0.lib"
      LIBS +="C:/Basler/pylon6/Development/lib/x64/PylonUtility_v6_0.lib"
      
      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 15 Oct 2019, 12:18 last edited by
      #2

      @hodahle said in Pylon in Qt compilation issues:

      Microsoft seems to want you to pay in order to get an actual copy of VS2017

      Community edition is enough (even build tools would be enough). Did you select C++ support when installing VS2017?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      H 2 Replies Last reply 15 Oct 2019, 13:27
      0
      • J jsulm
        15 Oct 2019, 12:18

        @hodahle said in Pylon in Qt compilation issues:

        Microsoft seems to want you to pay in order to get an actual copy of VS2017

        Community edition is enough (even build tools would be enough). Did you select C++ support when installing VS2017?

        H Offline
        H Offline
        hodahle
        wrote on 15 Oct 2019, 13:27 last edited by
        #3

        @jsulm Yes, I did. This is what I have selected for my VSC2019 installation:
        issues2.PNG

        And this is what my compilers page looks like:
        issues3.PNG

        Qt complains about the ABI not matching, which is fair enough since it expects the 2017 version, but it doesn't seem to detect it.

        1 Reply Last reply
        0
        • J jsulm
          15 Oct 2019, 12:18

          @hodahle said in Pylon in Qt compilation issues:

          Microsoft seems to want you to pay in order to get an actual copy of VS2017

          Community edition is enough (even build tools would be enough). Did you select C++ support when installing VS2017?

          H Offline
          H Offline
          hodahle
          wrote on 15 Oct 2019, 14:49 last edited by
          #4

          @jsulm Apologies, I misread your response.

          You're right, you can get VSC2017 for free from Microsoft, I just assumed I would have to pay for it because it said I needed a license. My mistake.

          I have installed VSC2017 successfully and it now detects the compiler properly, along with not throwing a bunch of syntax errors on compilation. That's good. It compiles successfully if I don't try to include any of the libraries but only link them in the project file. However, if I do, I get a couple of errors.

          The debug build produces the following:

          :-1: error: LNK1104: cannot open file 'GCBase_MDd_VC141_v3_1_Basler_pylon.lib'
          

          Which is weird, since I specifically link to that library, but whatever, if I switch to release build, I get the following error:

          :-1: error: LNK1104: cannot open file 'PylonUtility_MD_VC100.lib'
          

          That one's a little more understandable, since I don't actually link to that library, but that file is not included in the lib folder in the Pylon SDK. I tried googling it, but I couldn't really find anything relevant on it.

          H 1 Reply Last reply 15 Oct 2019, 15:48
          0
          • H hodahle
            15 Oct 2019, 14:49

            @jsulm Apologies, I misread your response.

            You're right, you can get VSC2017 for free from Microsoft, I just assumed I would have to pay for it because it said I needed a license. My mistake.

            I have installed VSC2017 successfully and it now detects the compiler properly, along with not throwing a bunch of syntax errors on compilation. That's good. It compiles successfully if I don't try to include any of the libraries but only link them in the project file. However, if I do, I get a couple of errors.

            The debug build produces the following:

            :-1: error: LNK1104: cannot open file 'GCBase_MDd_VC141_v3_1_Basler_pylon.lib'
            

            Which is weird, since I specifically link to that library, but whatever, if I switch to release build, I get the following error:

            :-1: error: LNK1104: cannot open file 'PylonUtility_MD_VC100.lib'
            

            That one's a little more understandable, since I don't actually link to that library, but that file is not included in the lib folder in the Pylon SDK. I tried googling it, but I couldn't really find anything relevant on it.

            H Offline
            H Offline
            hodahle
            wrote on 15 Oct 2019, 15:48 last edited by
            #5

            @hodahle

            Update:

            This has been a wild goosechase and a half, but I finally got at least the sample projects to run under Visual Studio 2010, which is apparently the version it expects, but I don't know how to get that working with new Qt, since the Visual C++ 2010 compiler can't compile Qt 5.13.

            There might be some trickery with using the older build tools with a new compiler or something, but honestly, this is moving pretty firmly outside my current realm of understanding. Any help on how to proceed would be much appreciated.

            J 1 Reply Last reply 16 Oct 2019, 05:40
            0
            • H hodahle
              15 Oct 2019, 15:48

              @hodahle

              Update:

              This has been a wild goosechase and a half, but I finally got at least the sample projects to run under Visual Studio 2010, which is apparently the version it expects, but I don't know how to get that working with new Qt, since the Visual C++ 2010 compiler can't compile Qt 5.13.

              There might be some trickery with using the older build tools with a new compiler or something, but honestly, this is moving pretty firmly outside my current realm of understanding. Any help on how to proceed would be much appreciated.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 16 Oct 2019, 05:40 last edited by
              #6

              @hodahle My guess is that the libs you want to use were built using MSVC2010 which is not compatible with MSVC2017.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              H 1 Reply Last reply 16 Oct 2019, 08:26
              0
              • J jsulm
                16 Oct 2019, 05:40

                @hodahle My guess is that the libs you want to use were built using MSVC2010 which is not compatible with MSVC2017.

                H Offline
                H Offline
                hodahle
                wrote on 16 Oct 2019, 08:26 last edited by
                #7

                @jsulm You can build it in newer version of Visual Studio as long as you have the old build tools. Seems it is dependent on MSVC2010, which is a disappointment to put it lightly.

                Not sure about using it with Qt, though. Would downloading an older version of Qt compatible with MSVC2010 be the best way of going about it? Or should I maybe try to see if I can get some other software working with it instead? QCamera doesn't seem to function with those types of cameras, at least not with the QCameraInfo::availableCameras() method, which only recognises my webcam. I'm at a bit of a loss here.

                J 1 Reply Last reply 16 Oct 2019, 08:28
                0
                • H hodahle
                  16 Oct 2019, 08:26

                  @jsulm You can build it in newer version of Visual Studio as long as you have the old build tools. Seems it is dependent on MSVC2010, which is a disappointment to put it lightly.

                  Not sure about using it with Qt, though. Would downloading an older version of Qt compatible with MSVC2010 be the best way of going about it? Or should I maybe try to see if I can get some other software working with it instead? QCamera doesn't seem to function with those types of cameras, at least not with the QCameraInfo::availableCameras() method, which only recognises my webcam. I'm at a bit of a loss here.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 16 Oct 2019, 08:28 last edited by
                  #8

                  @hodahle said in Pylon in Qt compilation issues:

                  Would downloading an older version of Qt compatible with MSVC2010 be the best way of going about it?

                  If you want to use Pylon and it only supports MSVC2010 then yes.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hodahle
                    wrote on 16 Oct 2019, 10:46 last edited by
                    #9

                    Side note for posterity, but I think I found a way to go about it which works better for me and doesn't involve messing around with MSVC.

                    For whatever reason, downloading the full Pylon SDK package with the viewer and everything doesn't work very well for me and doesn't let the cameras be recognised as such by my device.

                    However, if I use only a runtime (I used v5.2, but you could probably use a different one too), it works and gets recognised. QCamera now also recognises the camera, though it fails to set proper viewfinder settings and therefore doesn't work. It also finds 4 cameras instead of just one, which I think is a quirk of the driver or something, since OpenCV does the same thing. I would prefer to do everything with Qt and not be dependent on any external framework, so if there's any pointers on how to set proper viewfinder settings that would be much appreciated, but for now this is fine.

                    What works and does recognise the camera while reading properly from the camera is OpenCV. In order to be used with MinGW, it has to be made from source with make, but I've managed to make it work on my machine. I followed this guide on the subject, and it worked for me after restarting.

                    Anyway, I finally have something I can work on again, and I'll consider this question solved. Thanks for the help.

                    R V 2 Replies Last reply 22 Feb 2021, 15:35
                    0
                    • H hodahle
                      16 Oct 2019, 10:46

                      Side note for posterity, but I think I found a way to go about it which works better for me and doesn't involve messing around with MSVC.

                      For whatever reason, downloading the full Pylon SDK package with the viewer and everything doesn't work very well for me and doesn't let the cameras be recognised as such by my device.

                      However, if I use only a runtime (I used v5.2, but you could probably use a different one too), it works and gets recognised. QCamera now also recognises the camera, though it fails to set proper viewfinder settings and therefore doesn't work. It also finds 4 cameras instead of just one, which I think is a quirk of the driver or something, since OpenCV does the same thing. I would prefer to do everything with Qt and not be dependent on any external framework, so if there's any pointers on how to set proper viewfinder settings that would be much appreciated, but for now this is fine.

                      What works and does recognise the camera while reading properly from the camera is OpenCV. In order to be used with MinGW, it has to be made from source with make, but I've managed to make it work on my machine. I followed this guide on the subject, and it worked for me after restarting.

                      Anyway, I finally have something I can work on again, and I'll consider this question solved. Thanks for the help.

                      R Offline
                      R Offline
                      rosmar
                      wrote on 22 Feb 2021, 15:35 last edited by
                      #10

                      @hodahle I have the same issue. My development environment is Qt Version 5.15.0. My application is written in C++ and will be compiled in Qt creator using MinGW/gcc compiler. I installed pylon 6.1.1 Camera Software Suite Windows in developer mode. I want to integrate it with our development environment to see if our application will include the libraries and successfully build and run. I don't have the camera yet but I think that it should be possible to get to this point where the application will successfully build and run with few calls to simple APIs.

                      I'm stuck. How did you get it working by using Runtime package instead of complete SDK Package (pylon X.x.x Camera Software Suite Windows)? Also can you please provide more information and if possible, can you please attach a screenshot of your .pro file?

                      1 Reply Last reply
                      0
                      • H hodahle
                        16 Oct 2019, 10:46

                        Side note for posterity, but I think I found a way to go about it which works better for me and doesn't involve messing around with MSVC.

                        For whatever reason, downloading the full Pylon SDK package with the viewer and everything doesn't work very well for me and doesn't let the cameras be recognised as such by my device.

                        However, if I use only a runtime (I used v5.2, but you could probably use a different one too), it works and gets recognised. QCamera now also recognises the camera, though it fails to set proper viewfinder settings and therefore doesn't work. It also finds 4 cameras instead of just one, which I think is a quirk of the driver or something, since OpenCV does the same thing. I would prefer to do everything with Qt and not be dependent on any external framework, so if there's any pointers on how to set proper viewfinder settings that would be much appreciated, but for now this is fine.

                        What works and does recognise the camera while reading properly from the camera is OpenCV. In order to be used with MinGW, it has to be made from source with make, but I've managed to make it work on my machine. I followed this guide on the subject, and it worked for me after restarting.

                        Anyway, I finally have something I can work on again, and I'll consider this question solved. Thanks for the help.

                        V Offline
                        V Offline
                        VikramJ
                        wrote on 5 Nov 2021, 12:05 last edited by
                        #11

                        @hodahle : Request you to share your .pro snippet as how you went about using runtime Pylon dlls in your mingw QT based code. It will be great as I am stuck in exact same issue

                        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