跳到內容
  • 版面
  • 最新
  • 標籤
  • 熱門
  • 使用者
  • 群組
  • 搜尋
  • Get Qt Extensions
  • Unsolved
Collapse
品牌標誌
  1. 首頁
  2. Qt Development
  3. Installation and Deployment
  4. [SOLVED] QT and boost : cannot find -llibboost_filesystem...
Forum Updated to NodeBB v4.3 + New Features

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

已排程 已置頂 已鎖定 已移動 Installation and Deployment
29 貼文 4 Posters 15.8k 瀏覽 4 Watching
  • 從舊到新
  • 從新到舊
  • 最多點贊
回覆
  • 在新貼文中回覆
登入後回覆
此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
  • Z 離線
    Z 離線
    zarachbaal
    寫於 最後由 編輯
    #5

    The errors about WSAStartup@8, WSACleanup@0... disappeared, that's a start !

    But I still have a bunch of undefined reference errors.
    A lot have "thread" in their name like :

    undefined reference to `_imp___ZN5boost6threadC1Ev'
    undefined reference to `_imp___ZN5boost6thread4joinEv'
    

    So I guess I also have to add the 'libboost_thread-mgw48-mt-1_52' library ?
    But I only have '.a' files in 'stage/lib' (no '.dll" or '.dll.a' files), and if I do '-llibbost_thread-mgw48-mt-1_52' it says it cannot find the library
    Maybe the lack of '.dll' and '.dll.a' is due to the 'failed updating 32 targets' when I built boost ?

    Also, I still have some
    undefined reference to boost::system::generic_category()
    undefined reference to boost::system::system_category()

    1 條回覆 最後回覆
    0
    • sneubertS 離線
      sneubertS 離線
      sneubert
      寫於 最後由 編輯
      #6

      I forgot to say, that I had to reorder the header includes to get a build.

      #include <boost/asio.hpp>
      #include <boost/property_tree/json_parser.hpp>
      #include <boost/thread.hpp>
      
      1 條回覆 最後回覆
      0
      • cybercatalystC 離線
        cybercatalystC 離線
        cybercatalyst
        寫於 最後由 編輯
        #7

        I can only suggest you talk with the one introducing boost (if you have to) and see whether you can get rid of it for obvious reasons. You will save yourself a lot of unnecessary work. Before trying that, I wouldn't investigate too much, this is lost time.

        Other than that, I am out here.

        Z 1 條回覆 最後回覆
        0
        • sneubertS 離線
          sneubertS 離線
          sneubert
          寫於 最後由 編輯
          #8

          @cybercatalyst
          I agree, but this wont solve the problem.

          1 條回覆 最後回覆
          0
          • cybercatalystC 離線
            cybercatalystC 離線
            cybercatalyst
            寫於 最後由 編輯
            #9

            It does solve the problem, because you the errors you see are linker errors caused by boost. If you just stick to the Qt classes like intended, you will not have those.

            1 條回覆 最後回覆
            -1
            • SGaistS 離線
              SGaistS 離線
              SGaist
              Lifetime Qt Champion
              寫於 最後由 編輯
              #10

              @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

              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 條回覆 最後回覆
              0
              • cybercatalystC cybercatalyst

                I can only suggest you talk with the one introducing boost (if you have to) and see whether you can get rid of it for obvious reasons. You will save yourself a lot of unnecessary work. Before trying that, I wouldn't investigate too much, this is lost time.

                Other than that, I am out here.

                Z 離線
                Z 離線
                zarachbaal
                寫於 最後由 編輯
                #11

                @cybercatalyst :

                In fact I'm using the EyeTribe eye tracking device and the SDK uses the boost library.
                So I have no choice but using it.

                1 條回覆 最後回覆
                0
                • cybercatalystC 離線
                  cybercatalystC 離線
                  cybercatalyst
                  寫於 最後由 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 條回覆 最後回覆
                  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 離線
                    sneubertS 離線
                    sneubert
                    寫於 最後由 編輯
                    #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 條回覆 最後回覆
                    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 離線
                      Z 離線
                      zarachbaal
                      寫於 最後由 編輯
                      #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 條回覆 最後回覆
                      0
                      • cybercatalystC 離線
                        cybercatalystC 離線
                        cybercatalyst
                        寫於 最後由 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 條回覆 最後回覆
                        0
                        • SGaistS 離線
                          SGaistS 離線
                          SGaist
                          Lifetime Qt Champion
                          寫於 最後由 編輯
                          #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 條回覆 最後回覆
                          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 離線
                            Z 離線
                            zarachbaal
                            寫於 最後由 編輯
                            #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 條回覆 最後回覆
                            0
                            • SGaistS 離線
                              SGaistS 離線
                              SGaist
                              Lifetime Qt Champion
                              寫於 最後由 編輯
                              #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 條回覆 最後回覆
                              0
                              • SGaistS SGaist

                                You can try adding DEFINES += BOOST_THREAD_USE_LIB

                                Z 離線
                                Z 離線
                                zarachbaal
                                寫於 最後由 zarachbaal 編輯
                                #19

                                @SGaist :

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

                                1 條回覆 最後回覆
                                0
                                • sneubertS 離線
                                  sneubertS 離線
                                  sneubert
                                  寫於 最後由 編輯
                                  #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 條回覆 最後回覆
                                  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 離線
                                    Z 離線
                                    zarachbaal
                                    寫於 最後由 編輯
                                    #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 條回覆 最後回覆
                                    0
                                    • sneubertS 離線
                                      sneubertS 離線
                                      sneubert
                                      寫於 最後由 編輯
                                      #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 條回覆 最後回覆
                                      0
                                      • Z 離線
                                        Z 離線
                                        zarachbaal
                                        寫於 最後由 編輯
                                        #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 條回覆 最後回覆
                                        0
                                        • Z 離線
                                          Z 離線
                                          zarachbaal
                                          寫於 最後由 編輯
                                          #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 條回覆 最後回覆
                                          0

                                          • 登入

                                          • Login or register to search.
                                          • 第一個貼文
                                            最後的貼文
                                          0
                                          • 版面
                                          • 最新
                                          • 標籤
                                          • 熱門
                                          • 使用者
                                          • 群組
                                          • 搜尋
                                          • Get Qt Extensions
                                          • Unsolved