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. Simple change in *.pro file and libraries no longer get found

Simple change in *.pro file and libraries no longer get found

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 2.0k Views 2 Watching
  • 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.
  • T Offline
    T Offline
    Tapsa
    wrote on last edited by Tapsa
    #1

    The only thing I changed was

    INCLUDEPATH += $$PWD/../../../Boost/include
    DEPENDPATH += $$PWD/../../../Boost/include
    

    to this

    INCLUDEPATH += $$PWD/../../../Boost/include/boost_1_60
    DEPENDPATH += $$PWD/../../../Boost/include/boost_1_60
    

    and I start getting these:
    cannot find -llibgenieutils.dll
    cannot find -llibboost... etc
    error: ld returned 1 exit status

    If I undo my changes to the pro file, nothing changes. How can I make Qt Creator work again? If I add those libraries again, I will get 100 % same code to Boost include paths. But as soon as I edit something, even if I change it back, the libraries get lost. I had this error before too, but I don't want to use the "Add Library..." wizard every time from mouse right-click.

    Am I not supposed to touch the pro file myself? I even deleted my build folders, but the problem persists.

    EDIT: I confirmed that this is a bug in qmake or whatever is responsible for finding the libraries, as I changed and changed the pro file trying to make it work, but eventually I changed it back to ...include/boost_1_60 etc and it suddenly works (only for debug this time). So 100 % same pro file works sometimes and sometimes not. It also varies whether it works for both release and debug builds or only one of them.

    EDIT2: Apparently I managed to do debug build only once, then Qt Creator refused to find the libraries again.

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

      hi
      when u have changed the pro file.
      you should run qmake from the menu.
      If its still funky, you can try to clean the build folder.

      Also, are you 100% sure its the only place that Boost is mentioned?
      there is not a LIBS += line or something like that?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tapsa
        wrote on last edited by
        #3

        Thanks :) looks like running qmake solves this... or not (only for debug build it did). I am getting program exited with code 0 in release build and then cannot find again. I ran clean/qmake/rebuild multiple times, still no luck.

        There is LIBS += but it worked before and I did not touch it at all.

        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../genieutils-build/release/ -llibgenieutils.dll
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../genieutils-build/debug/ -llibgenieutils.dll
        
        INCLUDEPATH += $$PWD/../genieutils/include
        DEPENDPATH += $$PWD/../genieutils/include
        
        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Boost/lib/ -llibboost_iostreams-mgw49-mt-1_60.dll
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Boost/lib/ -llibboost_iostreams-mgw49-mt-d-1_60.dll
        
        INCLUDEPATH += $$PWD/../../../Boost/include/boost_1_60
        DEPENDPATH += $$PWD/../../../Boost/include/boost_1_60
        
        kshegunovK 1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hmm
          debug and release do look very much alike to me.
          So both should work.

          1 Reply Last reply
          0
          • T Tapsa

            Thanks :) looks like running qmake solves this... or not (only for debug build it did). I am getting program exited with code 0 in release build and then cannot find again. I ran clean/qmake/rebuild multiple times, still no luck.

            There is LIBS += but it worked before and I did not touch it at all.

            win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../genieutils-build/release/ -llibgenieutils.dll
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../genieutils-build/debug/ -llibgenieutils.dll
            
            INCLUDEPATH += $$PWD/../genieutils/include
            DEPENDPATH += $$PWD/../genieutils/include
            
            win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../Boost/lib/ -llibboost_iostreams-mgw49-mt-1_60.dll
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../Boost/lib/ -llibboost_iostreams-mgw49-mt-d-1_60.dll
            
            INCLUDEPATH += $$PWD/../../../Boost/include/boost_1_60
            DEPENDPATH += $$PWD/../../../Boost/include/boost_1_60
            
            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by
            #5

            @Tapsa
            Hello,

            win32:CONFIG(release, debug|release): LIBS += -L$PWD/../genieutils-build/release/ -llibgenieutils.dll
            

            Do you have a file that's called liblibgenieutils.dll.lib, if not then you're using the flags wrong.
            qmake's -l flag will add the appropriate prefixes and suffixes for your platform, so you should use it accordingly:

            win32:CONFIG(release, debug|release): LIBS += -L$PWD/../genieutils-build/release/ -lgenieutils
            

            Kind regards.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            2
            • T Offline
              T Offline
              Tapsa
              wrote on last edited by
              #6

              Thank you, kshegunov.
              Removing "lib" and ".dll" seems to work for both release and debug builds now. Those were added by the "Add Library..." method of Qt Creator.

              kshegunovK 1 Reply Last reply
              0
              • T Tapsa

                Thank you, kshegunov.
                Removing "lib" and ".dll" seems to work for both release and debug builds now. Those were added by the "Add Library..." method of Qt Creator.

                kshegunovK Offline
                kshegunovK Offline
                kshegunov
                Moderators
                wrote on last edited by kshegunov
                #7

                @Tapsa

                Those were added by the "Add Library..." method of Qt Creator.

                This seems very improbable. To be sure however, I've used the "Add library" wizard for a chosen external library from another project and QtCreator generates the following for the .pro file:

                win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../ag/bin-debug/release/ -lagcore
                else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../ag/bin-debug/debug/ -lagcore
                else:unix: LIBS += -L$$PWD/../../ag/bin-debug/ -lagcore
                
                INCLUDEPATH += $$PWD/../../ag/bin-debug
                DEPENDPATH += $$PWD/../../ag/bin-debug
                

                As you can see there's neither "lib" prefix, nor ".so" extension in the generated code. Additionally notice that PWD is used with double dollar symbols, and not as $PWD. Either there's a bug in your creator, or you'd changed the generated code and forgot about it.

                Kind regards.

                Read and abide by the Qt Code of Conduct

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Tapsa
                  wrote on last edited by Tapsa
                  #8

                  I did not change those LIB lines and add library (external) only allowed me to choose *.A files. Thanks for pointing out that double dollar glitch too (phew, it was caused by this forum formatting). I am 100 % sure of this since I tried to use that add library multiple times and the result was same. I have static *.A and shared *.DLL.A and *.DLL I chose the *.DLL.A and got that -llibname.dll line.

                  kshegunovK 1 Reply Last reply
                  0
                  • T Tapsa

                    I did not change those LIB lines and add library (external) only allowed me to choose *.A files. Thanks for pointing out that double dollar glitch too (phew, it was caused by this forum formatting). I am 100 % sure of this since I tried to use that add library multiple times and the result was same. I have static *.A and shared *.DLL.A and *.DLL I chose the *.DLL.A and got that -llibname.dll line.

                    kshegunovK Offline
                    kshegunovK Offline
                    kshegunov
                    Moderators
                    wrote on last edited by
                    #9

                    @Tapsa
                    .a files are static libraries and additional instructions to qmake are needed to link them, but in any case I wouldn't wish to stray in that direction.

                    Read and abide by the Qt Code of Conduct

                    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