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 exiv2 with Qt

Integrating exiv2 with Qt

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
43 Posts 2 Posters 16.1k 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.
  • SGaistS SGaist

    Hi,

    Your .pro file is wrong. You shouldn't link to .dll files but to .lib files.

    So for exiv2 it should be something like LIBS += -lexiv2

    Did you also check that you are using the same compiler everywhere ? That's pretty important on Windows.

    On a side note, there's no need to have several time the exact same folder you your LIBS line.

    saitejS Offline
    saitejS Offline
    saitej
    wrote on last edited by
    #3

    @SGaist said in Integrating exiv2 with qt:

    On a side note, there's no need to have several time the exact same folder you your LIBS line.

    Thanks!! I will take note of that.

    I have made a few changes and got to compile but it crashes on startup. On running with the debugger, I have got this error message. If possible please throw some light on this error message.

    error:
    During startup program exited with code 0x0000c135

    .pro file

    win32{
    LIBS += -L$$PWD/libs/exif/lib/ -llibexiv2.dll

    INCLUDEPATH += $$PWD/libs/exif/include
    INCLUDEPATH += $$PWD/libs/exif/bin
    DEPENDPATH += $$PWD/libs/exif/include
    }

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      Again, don't link against .dll.

      Where is libexiv2.dll located on your computer ?

      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
      • saitejS Offline
        saitejS Offline
        saitej
        wrote on last edited by saitej
        #5

        I have put it in a libs folder in the project directory.

        When I import the libexiv2.dll.a via import external library in Qtcreator, It generates this in the .pro file. I have only added one line manually that is:

        INCLUDEPATH += $$PWD/libs/exif/bin in the .pro file

        Path of the dll:
        $$PWD/libs/exif/lib/

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #6

          Then you need to add that path to the PATH environment variable in the Run part of the Project panel. Otherwise your application won't find the .dll at startup. WARNING don't modify your system's PATH, just the one for running your application in Qt Creator.

          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
          • saitejS Offline
            saitejS Offline
            saitej
            wrote on last edited by
            #7

            @SGaist

            I have added the path in the run part.Right now, the run environment reads:

            Use Build Environment and
            Set EXIVPATH to C:\Users\Sai\Desktop\trial\exifdata\exifData\libs\exif\bin

            Should I add this EXIVPATH somewhere else?

            Thanks!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #8

              Again: you have to add that path to the PATH environment variable. The loader doesn't care about EXIVPATH to find the .dll it needs.

              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
              • saitejS Offline
                saitejS Offline
                saitej
                wrote on last edited by
                #9

                Sorry!

                I have now added in the Path variable. The error code has changed to 139

                1 Reply Last reply
                0
                • SGaistS SGaist

                  Hi,

                  Your .pro file is wrong. You shouldn't link to .dll files but to .lib files.

                  So for exiv2 it should be something like LIBS += -lexiv2

                  Did you also check that you are using the same compiler everywhere ? That's pretty important on Windows.

                  On a side note, there's no need to have several time the exact same folder you your LIBS line.

                  saitejS Offline
                  saitejS Offline
                  saitej
                  wrote on last edited by
                  #10

                  @SGaist said in Integrating exiv2 with qt:

                  Did you also check that you are using the same compiler everywhere ? That's pretty important on Windows.

                  I have compiled it using msys and mingw. I am not able to get the mingw32 version

                  I am using Qt installed from qt-opensource-windows-x86-mingw492-5.6.1-1.exe file.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #11

                    Do you mean that you get that error 139 at startup ?

                    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
                    0
                    • saitejS Offline
                      saitejS Offline
                      saitej
                      wrote on last edited by
                      #12

                      Sorry for the late reply!
                      Yes

                      During startup program exited with code 0x0000c139

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #13

                        AFAIK, it means that it fails to load a .dll Do you have other dependencies ?

                        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
                        0
                        • saitejS Offline
                          saitejS Offline
                          saitej
                          wrote on last edited by
                          #14

                          most probably no .. coz i gave local/bin also as the path

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by
                            #15

                            local/bin ? On Windows ?

                            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
                            0
                            • saitejS Offline
                              saitejS Offline
                              saitej
                              wrote on last edited by
                              #16

                              Ya ... mingw installation path!!

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #17

                                Just to rule out the obvious, can you copy the exiv2 .dll in the same folder as the application and check whether the application starts ?

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

                                saitejS 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  Just to rule out the obvious, can you copy the exiv2 .dll in the same folder as the application and check whether the application starts ?

                                  saitejS Offline
                                  saitejS Offline
                                  saitej
                                  wrote on last edited by
                                  #18

                                  @SGaist

                                  Sorry for the late reply!!

                                  Ya .. i have tried that already but gives the same error!

                                  In the mean time I actually have tried many libraries and all are having same problem. So I guess there is a problem in either the build or the way of including the library. I will brief you exactly what I have done and the versions.

                                  Build:

                                  • I have successfully build the source code in the qt project folder using --prefix option with msys terminal with mingw compiler.

                                  mingw32-g++.exe (GCC) 5.3.0
                                  mingw32-gcc-5.3.0.exe (GCC) 5.3.0

                                  • I am using Qt installed from qt-opensource-windows-x86-mingw492-5.6.1-1.exe

                                  • I have added mingw32-g++.exe (GCC) 5.3.0 as the compiler manually

                                  • I have added the external library (libexiv2.dll.a) in Qtcreator via Add Library external library and static mode.

                                  • I have also added to the PATH variable you have suggested.

                                  The .pro reads this:

                                  win32: LIBS += -L$$PWD/libs/exiv2build/lib/ -llibexiv2.dll
                                  
                                  INCLUDEPATH += $$PWD/libs/exiv2build/include
                                  DEPENDPATH += $$PWD/libs/exiv2build/include
                                  
                                  

                                  It still gives me the error During startup program exited with code 0x0000c139.

                                  Any suggestion on what might have gone wrong?

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #19

                                    Do I understand understand correctly that you are trying to run application with libraries built with two different versions of MinGW ?

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

                                    saitejS 1 Reply Last reply
                                    0
                                    • SGaistS SGaist

                                      Do I understand understand correctly that you are trying to run application with libraries built with two different versions of MinGW ?

                                      saitejS Offline
                                      saitejS Offline
                                      saitej
                                      wrote on last edited by saitej
                                      #20

                                      No.

                                      I have right now changed it to the same compiler by changing the kit

                                      Also, I have used the dependency walker on the dll file and have found problems in these dependencies:

                                      I have attached the dependencywalker image for the same:

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #21

                                        What image format is it ?

                                        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
                                        • saitejS Offline
                                          saitejS Offline
                                          saitej
                                          wrote on last edited by
                                          #22

                                          dependency walker

                                          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