Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qt Academy Launch in California!

    Solved Library linking problem with openCV

    General and Desktop
    2
    4
    171
    Loading More Posts
    • 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.
    • S
      Shane00 last edited by

      I am trying to run a sample code from OpenCV to ensure my library is linked properly. However, i am unable to find the dll or dll.a files when i right click on the project folder to add libraries., although they exist.
      pic1.png

      However, if i manually add libraries for my .pro file as shown, the project is able to build and run properly through the IDE.
      pic2.png

      Even so, i am unable to run the executable file directly without the ide with this error as shown.
      pic3.png

      Can someone tell me what is going on here? I have no clue. I guess i am using a static library with the .a files so why can't i run the executable file without running into run time error?

      1 Reply Last reply Reply Quote 0
      • B
        Bonnie last edited by Bonnie

        Programming basic: you need the dlls with the exe or in you PATH.
        If you run from the IDE, it will set the PATH for you (from the LIBS).
        And no, you are not linking static library, if yes they won't be called "*.dll.a".
        About the first picture, I think you've clicked the wrong button, because it seems to want a folder, not files.

        S 1 Reply Last reply Reply Quote 0
        • S
          Shane00 @Bonnie last edited by

          @Bonnie So dll.a files are considered dynamic? I have a binary folder with dll files & exe files. Also i have a lib folder with dll.a files. Which one should i include?

          B 1 Reply Last reply Reply Quote 0
          • B
            Bonnie @Shane00 last edited by Bonnie

            @Shane00
            .a files are just like .lib files, it might be a static library, or it might be used to import a dynamic-link library.
            From its name you can see it is the latter.
            So you need to link the .dll.a files in the .pro file to create your exe file and when running the program you need .dll files.
            And what you need to "include" are the header files.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post