BOOST link problem
-
wrote on 29 Jan 2019, 06:39 last edited by davecotter
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):
Everything links and runs on mac. however, on windows i get these and a gazillion more link errors:
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
-
wrote on 29 Jan 2019, 18:01 last edited by
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!!
-
wrote on 29 Jan 2019, 06:55 last edited by davecotter
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
-
You're trying to linkg against 64bit boost libs but your Qt is only build with 32bits this won't work.
-
wrote on 29 Jan 2019, 07:00 last edited by
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?
-
You definitely using a 32bit Qt version. If you want a 64Bit app, you should use a 64Bit Qt.
-
wrote on 29 Jan 2019, 07:10 last edited by davecotter
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?
-
I talk about Qt, not Qt-Creator - Qt-Creator is just an IDE. How did you install your Qt?
-
wrote on 29 Jan 2019, 07:37 last edited by davecotter
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
-
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
-
wrote on 29 Jan 2019, 07:55 last edited by
-
sorry if i wasn't clear, but i did state that my kit is MSVC2017 64bit.
Here is what is currently installed:
And here is my kit selection:
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?
@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?
-
@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'
-
wrote on 29 Jan 2019, 08:11 last edited by
now i'm not so sure. i'll rebuild boost in the morning and report back
-
wrote on 29 Jan 2019, 18:01 last edited by
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/14