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. adding boost libraries
Forum Updated to NodeBB v4.3 + New Features

adding boost libraries

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.4k Views 1 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.
  • B Offline
    B Offline
    Bharth
    wrote on 13 Oct 2018, 06:32 last edited by
    #1

    HI guys,,
    can anybody kindly suggest me to solve this problem i.e. already i have build boost libraries & added paths into project although im getting these errors in .pro file

    error: cannot find -lboost_random
    :-1: error: cannot find -lboost_system
    :-1: error: cannot find -lboost_date_time
    collect2.exe:-1: error: error: ld returned 1 exit status

    .pro file

    ONFIG(debug, debug|release):DEFINES +=DEBUG=1
    INCLUDEPATH += $$PWD/../../external/include
    DEPENDPATH += $$PWD/../../external/lib/boost
    CONFIG(release, debug|release): LIBS += -L$$PWD/../../external/lib/boost/ -lboost_random
    else:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../external/lib/boost/ -lboost_random

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

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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 13 Oct 2018, 08:29 last edited by
      #2

      Print value of $$PWD/../../external/lib/boost/ to verify that the path is correct. Make sure that libboost_random.so is in that folder.

      (Z(:^

      1 Reply Last reply
      5
      • B Offline
        B Offline
        Bharth
        wrote on 13 Oct 2018, 09:59 last edited by
        #3

        libboost_date_time-vc110-mt-gd-x64-1_68
        libboost_date_time-vc110-mt-x32-1_68
        libboost_date_time-vc110-mt-x64-1_68
        libboost_date_time-vc110-mt-gd-x64-1_68
        already i have these libraries in the folder

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 13 Oct 2018, 12:22 last edited by
          #4

          Clearly, there is no boost_random and boost_system in the list you provided. So no wonder qmake can't find them.

          Please make sure the libs are where you tell qmake/ linker to look for them.

          (Z(:^

          1 Reply Last reply
          3
          • B Offline
            B Offline
            Bharth
            wrote on 15 Oct 2018, 04:37 last edited by Bharth
            #5

            i had given you just one example, out of 4 errors
            i have libboost-system , libboost-random and libboost-date_time

            S 1 Reply Last reply 15 Oct 2018, 05:57
            0
            • B Bharth
              15 Oct 2018, 04:37

              i had given you just one example, out of 4 errors
              i have libboost-system , libboost-random and libboost-date_time

              S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 15 Oct 2018, 05:57 last edited by
              #6

              @Bharth said in adding boost libraries:

              i had given you just one example, out of 4 errors
              i have libboost-system , libboost-random and libboost-date_time

              OK, but you keep mixing the names. You have to make sure that names of your libraries and their inclusion in project file matches. It can't just "look a bit similar". It has to be the same name, down to every character.

              The only thing that -l flag will do, is to add "lib" in front of the string, and ".so" at the end on unix platforms, and on Windows it will only add ".lib" at the end.

              So:

              -lboost_date_time expects boost_date_time.lib, not libboost_date_time-vc110-mt-gd-x64-1_68. Modify your project file for these strings to match, or provide the library name directly (see the docs).

              (Z(:^

              1 Reply Last reply
              3
              • B Offline
                B Offline
                Bharth
                wrote on 15 Oct 2018, 06:40 last edited by
                #7

                libboost_date_time-vc110-mt-gd-x64-1_68
                libboost_date_time-vc110-mt-x32-1_68
                libboost_date_time-vc110-mt-x64-1_68
                libboost_date_time-vc110-mt-gd-x64-1_68

                want me to give in this name boost_date_time.lib for all the above????

                S 1 Reply Last reply 15 Oct 2018, 06:43
                0
                • B Bharth
                  15 Oct 2018, 06:40

                  libboost_date_time-vc110-mt-gd-x64-1_68
                  libboost_date_time-vc110-mt-x32-1_68
                  libboost_date_time-vc110-mt-x64-1_68
                  libboost_date_time-vc110-mt-gd-x64-1_68

                  want me to give in this name boost_date_time.lib for all the above????

                  S Offline
                  S Offline
                  sierdzio
                  Moderators
                  wrote on 15 Oct 2018, 06:43 last edited by
                  #8

                  @Bharth said in adding boost libraries:

                  want me to give in this name boost_date_time.lib for all the above????

                  I don't understand what you mean.

                  What you need to do is to change your project file so that the -l flags describe your .lib files exactly. The names must match. How you do it does not matter. You can rename the .lib files or change the name in .pro file.

                  (Z(:^

                  1 Reply Last reply
                  3

                  1/8

                  13 Oct 2018, 06:32

                  • Login

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