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 link problem
QtWS25 Last Chance

BOOST link problem

Scheduled Pinned Locked Moved Solved General and Desktop
14 Posts 4 Posters 1.6k 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.
  • D Offline
    D Offline
    davecotter
    wrote on 29 Jan 2019, 06:39 last edited by davecotter
    #1

    I have a legacy project that is has boost threads deeply embedded (so please take it for granted that boost_thread is a requirement, i KNOW that a new project shouldn't use it, but that's not what my question is about).

    In porting this project (for both mac and windows), i have this in my pro file:

    # assume DIR_EXTERNAL is properly set up
    DIR_BOOST			= $${DIR_EXTERNAL}boost_1_68_0/
    DIR_BOOST_LIBS			= $${DIR_BOOST}stage/lib/
    
    macx {
    	LIB_BOOST_THREAD	= boost_thread
    	LIB_BOOST_SYSTEM	= boost_system
    } else {
    	DEFINES += BOOST_USE_WINDOWS_H
    	DEFINES += BOOST_THREAD_USE_LIB
    
    	CONFIG(release, debug|release) {
    		BOOST_BUILD_TYPE_SUFFIX = ""
    	} else {
    		BOOST_BUILD_TYPE_SUFFIX = "-gd"
    	}
    
    	LIB_BOOST_SUFFIX	= -vc141-mt$${BOOST_BUILD_TYPE_SUFFIX}-x64-1_68
    
    	LIB_BOOST_SYSTEM	= libboost_system$${LIB_BOOST_SUFFIX}
    	LIB_BOOST_THREAD	= libboost_thread$${LIB_BOOST_SUFFIX}
    }
    
    LIBS += -L$${DIR_BOOST_LIBS}
    LIBS += -l$${LIB_BOOST_SYSTEM}
    LIBS += -l$${LIB_BOOST_THREAD}
    
    INCLUDEPATH += $${DIR_BOOST}
    INCLUDEPATH += $${DIR_BOOST_LIBS}
    

    And i can assure you that the correct libs are indeed in that folder (properly built):

    0_1548736480888_Screen Shot 2019-01-28 at 8.34.20 PM.png

    Everything links and runs on mac. however, on windows i get these and a gazillion more link errors:

    0_1548743642337_Screen Shot 2019-01-28 at 10.33.31 PM.png

    so? what is going on? i've googled and researched and i know a lot of people have this same problem but i can't seem to see a definitive solution...

    if it matters, i'm using Qt Creator 4.8.1 and my kit is Qt 5.12.0 MSVC2017 64bit. i tried linking to chrono and date_time too but no change

    1 Reply Last reply
    0
    • D Offline
      D Offline
      davecotter
      wrote on 29 Jan 2019, 18:01 last edited by
      #14

      okay so here's what i found for my existing libs:

      Z:\kJams\External\boost_1_68_0\stage\lib>dumpbin libboost_thread-vc141-mt-gd-x64-1_68.lib /headers | findstr machine
                   14C machine (x86)
      

      and i'm like... WHAT? this bin file SAYS "x64" in it's name, yet it's geared to an x86 machine?? How is that possible? why would that happen? any idea? that's not something i would have ever thought to question.

      Okay so i'm going to rebuild the whole boost kitt'n-kaboodle. fine.

      since i'm rebuilding, i'm going with 1.69.
      when i build, running the command line tools for VS2017, of course. i'm just doing the default everything, like this:

      bootstrap
      .\b2
      

      right? i am assuming it's going to build 64bit, am i wrong?
      but i see this quite a bit:

      c:\python27\include\pymath.h(22): warning C4273: 'round': inconsistent dll linkage
      C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(533): note: see previous definition of 'round'
      

      should i be worried?

      this build results in the following:

      Z:\kJams\External\boost_1_69_0\stage\lib>dumpbin libboost_system-vc141-mt-gd-x64-1_69.lib /headers | findstr machine
                  8664 machine (x64)
      

      and that seems more like it.

      AND HOLY CATS that was the whole problem!!

      Thanks everyone for the hints and tips. I hope this topic helps someone in the future!!

      1 Reply Last reply
      3
      • D Offline
        D Offline
        davecotter
        wrote on 29 Jan 2019, 06:55 last edited by davecotter
        #2

        huh, here's a hint:

        ..\..\..\External\boost_1_68_0\stage\lib\libboost_thread-vc141-mt-gd-x64-1_68.lib : warning LNK4272: library machine type 'x86' conflicts with target machine type 'x64'
        

        so now i'm no longer SURE that the libs were built correctly??

        this article seems related but i don't know how to interpret it

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on 29 Jan 2019, 06:58 last edited by
          #3

          You're trying to linkg against 64bit boost libs but your Qt is only build with 32bits this won't work.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          3
          • D Offline
            D Offline
            davecotter
            wrote on 29 Jan 2019, 07:00 last edited by
            #4

            i know it's not working. and an explanation of WHY it's not working is a step forward, so thanks for that. but do you have a suggestion as to how to make it work? I'm building a 64bit application, i thought everything was 64bit? i see that QtCreator itself is 32bit, which seems odd. I don't see an installer for a 64bit version? or... what exactly do i do to fix this?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on 29 Jan 2019, 07:06 last edited by
              #5

              You definitely using a 32bit Qt version. If you want a 64Bit app, you should use a 64Bit Qt.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              2
              • D Offline
                D Offline
                davecotter
                wrote on 29 Jan 2019, 07:10 last edited by davecotter
                #6

                Are you talking about the “QT creator“ application? I can’t find an installer for the 64-bit version, where is it? If you do not mean that, then please explain step-by-step how I am supposed to get a 64-bit version of whatever it is that you are actually referring to?

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on 29 Jan 2019, 07:14 last edited by
                  #7

                  I talk about Qt, not Qt-Creator - Qt-Creator is just an IDE. How did you install your Qt?

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  1
                  • D Offline
                    D Offline
                    davecotter
                    wrote on 29 Jan 2019, 07:37 last edited by davecotter
                    #8

                    I used the live installer, and there was no mention of choosing between 32 and 64 bit

                    Please just tell me in no uncertain terms, how to get this 64-bit version of QT

                    J.HilkJ 1 Reply Last reply 29 Jan 2019, 07:42
                    0
                    • D davecotter
                      29 Jan 2019, 07:37

                      I used the live installer, and there was no mention of choosing between 32 and 64 bit

                      Please just tell me in no uncertain terms, how to get this 64-bit version of QT

                      J.HilkJ Offline
                      J.HilkJ Offline
                      J.Hilk
                      Moderators
                      wrote on 29 Jan 2019, 07:42 last edited by
                      #9

                      @davecotter
                      0_1548747740612_165c2044-b928-4835-a88a-19840c1b89f4-image.png


                      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                      Q: What's that?
                      A: It's blue light.
                      Q: What does it do?
                      A: It turns blue.

                      1 Reply Last reply
                      2
                      • D Offline
                        D Offline
                        davecotter
                        wrote on 29 Jan 2019, 07:55 last edited by
                        #10

                        sorry if i wasn't clear, but i did state that my kit is MSVC2017 64bit.

                        Here is what is currently installed:

                        0_1548748446847_Screen Shot 2019-01-28 at 11.53.11 PM.png

                        And here is my kit selection:

                        0_1548748476345_Screen Shot 2019-01-28 at 11.53.32 PM.png

                        I thought you were talking about the Qt Creator app itself, which is, in fact, 32bit.

                        So, since that is not the problem, then what is?

                        aha_1980A 1 Reply Last reply 29 Jan 2019, 07:56
                        0
                        • D davecotter
                          29 Jan 2019, 07:55

                          sorry if i wasn't clear, but i did state that my kit is MSVC2017 64bit.

                          Here is what is currently installed:

                          0_1548748446847_Screen Shot 2019-01-28 at 11.53.11 PM.png

                          And here is my kit selection:

                          0_1548748476345_Screen Shot 2019-01-28 at 11.53.32 PM.png

                          I thought you were talking about the Qt Creator app itself, which is, in fact, 32bit.

                          So, since that is not the problem, then what is?

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on 29 Jan 2019, 07:56 last edited by
                          #11

                          @davecotter said in BOOST link problem:

                          So, since that is not the problem, then what is?

                          Boost? Are you sure, boost is 64 bit too?

                          Qt has to stay free or it will die.

                          1 Reply Last reply
                          0
                          • C Offline
                            C Offline
                            Christian Ehrlicher
                            Lifetime Qt Champion
                            wrote on 29 Jan 2019, 08:08 last edited by
                            #12

                            @aha_1980 said in BOOST link problem:

                            Boost? Are you sure, boost is 64 bit too?

                            At least the naming of the lib suggest this although the Linker error says that the library is x86:

                            library machine type 'x86' conflicts with target machine type 'x64'

                            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                            Visit the Qt Academy at https://academy.qt.io/catalog

                            1 Reply Last reply
                            3
                            • D Offline
                              D Offline
                              davecotter
                              wrote on 29 Jan 2019, 08:11 last edited by
                              #13

                              now i'm not so sure. i'll rebuild boost in the morning and report back

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                davecotter
                                wrote on 29 Jan 2019, 18:01 last edited by
                                #14

                                okay so here's what i found for my existing libs:

                                Z:\kJams\External\boost_1_68_0\stage\lib>dumpbin libboost_thread-vc141-mt-gd-x64-1_68.lib /headers | findstr machine
                                             14C machine (x86)
                                

                                and i'm like... WHAT? this bin file SAYS "x64" in it's name, yet it's geared to an x86 machine?? How is that possible? why would that happen? any idea? that's not something i would have ever thought to question.

                                Okay so i'm going to rebuild the whole boost kitt'n-kaboodle. fine.

                                since i'm rebuilding, i'm going with 1.69.
                                when i build, running the command line tools for VS2017, of course. i'm just doing the default everything, like this:

                                bootstrap
                                .\b2
                                

                                right? i am assuming it's going to build 64bit, am i wrong?
                                but i see this quite a bit:

                                c:\python27\include\pymath.h(22): warning C4273: 'round': inconsistent dll linkage
                                C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt\corecrt_math.h(533): note: see previous definition of 'round'
                                

                                should i be worried?

                                this build results in the following:

                                Z:\kJams\External\boost_1_69_0\stage\lib>dumpbin libboost_system-vc141-mt-gd-x64-1_69.lib /headers | findstr machine
                                            8664 machine (x64)
                                

                                and that seems more like it.

                                AND HOLY CATS that was the whole problem!!

                                Thanks everyone for the hints and tips. I hope this topic helps someone in the future!!

                                1 Reply Last reply
                                3

                                1/14

                                29 Jan 2019, 06:39

                                • Login

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