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. boost lib error
Qt 6.11 is out! See what's new in the release blog

boost lib error

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 5 Posters 2.3k 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.
  • B Offline
    B Offline
    Bharth
    wrote on last edited by VRonin
    #1

    Hi guys......
    please help how to slove this problem
    after adding boost libraries im getting these errors...........................

    error: undefined reference to `boost::system::detail::system_category_ncx()'
    error:undefined reference to `boost::system::detail::generic_category_ncx()'
    collect2.exe:-1: error: error: ld returned 1 exit status
    

    this is header file error_code.hpp here im getting error

    inline const error_category & system_category() BOOST_SYSTEM_NOEXCEPT
    {
        return detail::system_category_ncx();
    }
    
    inline const error_category & generic_category() BOOST_SYSTEM_NOEXCEPT
    {
        return detail::generic_category_ncx();
    }
    
    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Boost system is not header-only. You need to build boost and link it to your app (LIBS += in qmake/QtCreator)

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bharth
        wrote on last edited by
        #3

        i added this is .pro file

        INCLUDEPATH += $$PWD/../../external/include
        DEPENDPATH += $$PWD/../../external/lib/boost

        CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_random-x32
        else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_random-x32-gd

        CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_system-x32
        else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_system-x32-gd

        CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_date_time-x32
        else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost -lboost_date_time-x32-gd

        1 Reply Last reply
        0
        • jiancaiyangJ Offline
          jiancaiyangJ Offline
          jiancaiyang
          wrote on last edited by
          #4

          Boost::system could be built statically using its source code, I think it is better than linking libraries.

          我们自己的论坛:http://qtdream.com
          擅长三维角色仿真动画。

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Dimple
            wrote on last edited by
            #5

            hello bharth,,,,
            follow these steps bcz it doesnt work with lib files so alrdy u hv built boost libraries so rebuild it as below,,
            1.download boost
            2.build boost in command prompt (else install developer command prompt)
            3.while building u should add these paths,,
            drive name (ex. D: then click on enter)
            cd enter path where ur boost has downloaded(ex. cd D:\boost_1_68_0) click on enter & add
            bootstrap.bat again click on enter wait until it completes itz building after that add this path
            b2 toolset=gcc (it takes some time to build if u find any error after adding this ,,,error like command not recognised gc++...etc then install mingw then it works fine )
            after building u get .a files do copy paste into ur lib folder .

            1 Reply Last reply
            1
            • B Offline
              B Offline
              Bharth
              wrote on last edited by Bharth
              #6

              ok thank you dimple

              1 Reply Last reply
              0
              • B Offline
                B Offline
                Bharth
                wrote on last edited by
                #7

                although getting same errors want me to change path names??

                RatzzR 1 Reply Last reply
                0
                • B Bharth

                  although getting same errors want me to change path names??

                  RatzzR Offline
                  RatzzR Offline
                  Ratzz
                  wrote on last edited by Ratzz
                  #8

                  @Bharth
                  I Prefer building boost using CMake GUI using suitable compiler.
                  Steps: https://svn.boost.org/trac10/wiki/CMakeConfigAndBuild#ConfiguretheBoostsourcetree

                  What compile do you use? What are the binaries you use build with ? What is the build configuration of those libraries?

                  --Alles ist gut.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    Dimple
                    wrote on last edited by
                    #9

                    INCLUDEPATH += $$PWD/../../external/include
                    win32: DEPENDPATH += $$PWD/../../external/lib/boost/win32/
                    else:unix: DEPENDPATH += $$PWD/../../external/lib/boost/mac/

                    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_random-mgw63-x32
                    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_random-mgw63-d-x32
                    else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_random

                    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_system-mgw63-x32
                    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_system-mgw63-d-x32
                    else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_system

                    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_date_time-mgw63-x32
                    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/win32 -lboost_date_time-mgw63-d-x32
                    else:unix: LIBS += -L$$PWD/../../external/lib/boost/mac -lboost_date_time

                    win32: LIBS += -lws2_32

                    bharth change path name & add last line into pro.file

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      Bharth
                      wrote on last edited by
                      #10

                      ya thank you errors cleared.....

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        Dimple
                        wrote on last edited by
                        #11

                        welcome #bharth

                        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