Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Import dynamic library - Failed ?

Import dynamic library - Failed ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 1.2k 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.
  • LordfulL Offline
    LordfulL Offline
    Lordful
    wrote on last edited by
    #1

    Hello,

    I'm still new in Qt and I'm trying to import a library that I created in a new project.

    I followed this topic : Here but it doesn't seem to work.

    When I add the library to my project, I used right click --> add library --> external and I select this previous dylib generated.

    But if I'm trying to add the include on main.cpp of my project, I can't find headers of my lib.

    PS : Sorry for examples but I can't posted the code... don't know why.

    Thanks for help,

    Kind Regards.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      Its not really clear what is the issue. :)

      If your lib is located in another folder and the .h files is also there, you might need
      to add the sub folder to the .pro file for it to really find it.

      http://stackoverflow.com/questions/1176666/how-to-create-a-subdirectory-for-a-project-qtcreator

      LordfulL 1 Reply Last reply
      0
      • mrjjM mrjj

        hi
        Its not really clear what is the issue. :)

        If your lib is located in another folder and the .h files is also there, you might need
        to add the sub folder to the .pro file for it to really find it.

        http://stackoverflow.com/questions/1176666/how-to-create-a-subdirectory-for-a-project-qtcreator

        LordfulL Offline
        LordfulL Offline
        Lordful
        wrote on last edited by
        #3

        @mrjj Yes I know that it's pretty hard to understand my problem without an explanation of what I do.

        I try to create a dynamic library of a project, for that, I followed the tutorial that I said on the first post. (Changing the template + adding some stuff on my header). When I build this project, I have .dylib which are created in the build folder of the library.

        After that, I need to add this library to my current project. For that, I add this to my pro files :

        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug/release/ -lTestLib
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug/debug/ -lTestLib
        else:unix: LIBS += -L$$PWD/../build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug/ -lTestLib.1.0.0
        
        INCLUDEPATH += $$PWD/../build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug
        DEPENDPATH += $$PWD/../build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug
        

        After that, I'm supposed to be able to import a class of my lib in the main of the current project, but I can't. (Just like the tutorial referred on first post).

        I will see what you sent.

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

          @Lordful said:

          build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug

          does this folder contain the .h file?

          It seems pretty ok.

          LordfulL 1 Reply Last reply
          0
          • mrjjM mrjj

            @Lordful said:

            build-TestLib-Desktop_Qt_5_5_1_clang_64bit-Debug

            does this folder contain the .h file?

            It seems pretty ok.

            LordfulL Offline
            LordfulL Offline
            Lordful
            wrote on last edited by
            #5

            @mrjj Hum of course, this folder doesn't contain the header of my file.

            1 Reply Last reply
            1

            • Login

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