Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] QT and boost : cannot find -llibboost_filesystem...
QtWS25 Last Chance

[SOLVED] QT and boost : cannot find -llibboost_filesystem...

Scheduled Pinned Locked Moved Installation and Deployment
29 Posts 4 Posters 14.7k 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.
  • cybercatalystC Offline
    cybercatalystC Offline
    cybercatalyst
    wrote on last edited by cybercatalyst
    #12

    No offense, but in that case you should contact their support instead asking here. I hope you understand, this is not something the community could/should help you with as the source of problems clearly is the usage of boost.

    (in the sense to make them aware of their fault, you should request them to fix it)

    sneubertS 1 Reply Last reply
    0
    • cybercatalystC cybercatalyst

      No offense, but in that case you should contact their support instead asking here. I hope you understand, this is not something the community could/should help you with as the source of problems clearly is the usage of boost.

      (in the sense to make them aware of their fault, you should request them to fix it)

      sneubertS Offline
      sneubertS Offline
      sneubert
      wrote on last edited by
      #13

      @cybercatalyst

      Using boost and qt together is not uncommon. There are indeed some libraries in boost that have no equivalent replacement in qt. Sure this seems not to be a qt issue, but if you do not want to help, just leave it. I for one, as part of the community saved a lot of time looking at posts like this. And by the way the valuable answers have never been something like "dont do that" or "ask someone else".

      1 Reply Last reply
      0
      • SGaistS SGaist

        @zarachbaal said:

        undefined reference to `_imp___ZN5boost6threadC1Ev

        Hi,

        You're not linking to the boost_thread library.

        You missing something like:
        LIBS += -lboost_thread-mgw48-mt-1_52
        or similar

        Z Offline
        Z Offline
        zarachbaal
        wrote on last edited by
        #14

        @SGaist :

        I added "-lboost_thread-mgw48-mt-1_52" at the end of my "LIBS +=..." line.
        It finds the library but I still have those errors...

        I also changed the order of my includes as sneubert suggested but that did not help

        @cybercatalyst :

        I will contact them about this but I have to make it work on Qt for the next week...

        1 Reply Last reply
        0
        • cybercatalystC Offline
          cybercatalystC Offline
          cybercatalyst
          wrote on last edited by cybercatalyst
          #15

          @sneubert said:

          Using boost and qt together is not uncommon.

          Yes, you are right! And it's the source for a whole bunch of unnecessary issues. That's why I find it important to state it's the wrong way to go. The fact that boost and qt are being used side-by-side comes from the misconception that people want to somehow get rid of Qt on non-GUI code in lower level stuff because Qt is GUI-only. This is very bad and it's important to remind that Qt is an application framework.

          This is the only reason I am writing this and if it makes people to rethink then this has been very useful imo.

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

            Did you check that the library name is correct ? I've based it on the ones you're already using so I might have missed something

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

            Z 1 Reply Last reply
            0
            • SGaistS SGaist

              Did you check that the library name is correct ? I've based it on the ones you're already using so I might have missed something

              Z Offline
              Z Offline
              zarachbaal
              wrote on last edited by
              #17

              @SGaist :

              Yes I checked and the library is here, i even copy/pasted the name to be sure
              Qt does find the library, if I enter a wrong library name it gives an error (error : cannot find "false_library_name")

              As I said before I only have "libboost_thread-mgw48-mt-1_52.a" file.
              When I had '.a', '.dll' and '.dll.a' files for "libboost_system..."

              Maybe it has something to do about it ?

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

                You can try adding DEFINES += BOOST_THREAD_USE_LIB

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

                Z 1 Reply Last reply
                0
                • SGaistS SGaist

                  You can try adding DEFINES += BOOST_THREAD_USE_LIB

                  Z Offline
                  Z Offline
                  zarachbaal
                  wrote on last edited by zarachbaal
                  #19

                  @SGaist :

                  I just added your code, unfortunately it has no effect on the errors.

                  1 Reply Last reply
                  0
                  • sneubertS Offline
                    sneubertS Offline
                    sneubert
                    wrote on last edited by
                    #20

                    I checked my boost lib dir and I do have a libboost_thread-mgw... .dll and .lib so maybe you investigate the build of the boost libraries.

                    Z 1 Reply Last reply
                    0
                    • sneubertS sneubert

                      I checked my boost lib dir and I do have a libboost_thread-mgw... .dll and .lib so maybe you investigate the build of the boost libraries.

                      Z Offline
                      Z Offline
                      zarachbaal
                      wrote on last edited by
                      #21

                      @sneubert :

                      I downloaded and built boost 1.58.
                      This time I do have '.a', '.dll' and '.dll.a' for libbost_thread...
                      But it does not change anything

                      I don't recall doing anything in particular but the errors about 'thread' are not the same anymore.
                      They were like :
                      undefined reference to _imp___ZN5boost6threadC1Ev'
                      undefined reference to _imp___ZN5boost6thread4joinEv'

                      And now :
                      undefined reference to boost::thread::thread()'
                      undefined reference to boost::thread::joinable() const'

                      I just noticed that I have another error :
                      cc1plus.exe:-1: erreur : note: initialized from here
                      file not found : cc1plus.exe

                      1 Reply Last reply
                      0
                      • sneubertS Offline
                        sneubertS Offline
                        sneubert
                        wrote on last edited by
                        #22

                        cc1plus.exe is the cpp compiler invoked by gcc.
                        Do you have another MinGW installation on your system?
                        Maybe you have some references in your local or global PATH
                        environment variable pointing to the wrong MinGW bin dir?

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          zarachbaal
                          wrote on last edited by
                          #23

                          I have MinGW installed in C:/MinGW
                          And also the one that comes with Qt Creator.

                          In my PATH I have set "C:\Qt\qtcreator-2.4.1\mingw\bin"

                          Nevermind, this error appeared because I changed the MinGW to use in Project options.
                          If I select the MinGW that comes with Qt Creator this error disappears.

                          1 Reply Last reply
                          0
                          • Z Offline
                            Z Offline
                            zarachbaal
                            wrote on last edited by
                            #24

                            I may have an idea why it's not working.
                            I did not see, but I had Strawberry perl installed and it has mingw.
                            In my path I had "C:\Strawberry\c\bin" set, so I built boost using this mingw (v4.8.1) and the mingw that comes with Qt creator is v4.4.0

                            I removed strawberry from the path.
                            I am currently rebuilding boost with the correct mingw, will update tomorrow.

                            1 Reply Last reply
                            0
                            • sneubertS Offline
                              sneubertS Offline
                              sneubert
                              wrote on last edited by
                              #25

                              I´m curious about it.

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

                                Never modify PATH when you are developing (it should also be avoided as much as possible the rest of the time), it's in the same category as developing as root on linux ;)

                                More seriously, having MinGW or the Qt bin path in your PATH is an open door to a world of problem since you will be thing you are using one version of a library while in fact using another one. Also, MinGW isn't always compatible between two versions of their compiler. That's probably why you had problem in the first place since you where using two different versions.

                                In any case, one rule that you should apply on Windows: Use the same compiler for all your code and dependencies. It's not always possible but it will greatly simplify your life.

                                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
                                • Z Offline
                                  Z Offline
                                  zarachbaal
                                  wrote on last edited by
                                  #27

                                  That was it, it works fine now !

                                  @SGaist : I did not notice in the first place that I was using two versions of MinGW.
                                  When I installed Strawberry some weeks ago he added himself his path to the environement variable PATH.
                                  So I thought I was compiling boost with the MinGW from Qt Creator, I did not pay enough attention to the 'mg48' in librairies' name that should have been 'mg44'.

                                  How do I make this subject "solved" ?

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

                                    Windows can be tricky for that

                                    IF you don't have the option in the Topic Tools menu, just edit the thread title and prepend [solved]

                                    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
                                    • Z Offline
                                      Z Offline
                                      zarachbaal
                                      wrote on last edited by
                                      #29

                                      OK, thank you all for your help :)

                                      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