CMake not finding Boost library binaries (new naming convention for the binaries)












0















I begin by saying that this is not an issue with environment variables.



When I use the header only libraries everything works fine with this:



set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED)

if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(TestCMake Program.cpp)
target_link_libraries(TestCMake ${Boost_LIBRARIES})
endif()


But when I try to require a library by changing find_package(Boost REQUIRED) to find_package(Boost REQUIRED COMPONENTS system) I get an error:



Unable to find the requested Boost libraries.

Boost version: 1.67.0

Boost include path: D:/boost/boost_1_67_0

Could not find the following Boost libraries:

boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.


This answer on another question suggests that CMake expects the Boost binaries to be named in a certain way:



boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread


I have a precompiled binary (acquired from here) named boost_system-vc141-mt-x32-1_67.lib. How could I make CMake recognize the naming convention used in my binaries?



Comments to this downvoted answer on that other question suggest against renaming the files.










share|improve this question




















  • 2





    Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

    – Matthieu Brucher
    Nov 24 '18 at 10:08











  • Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

    – user3670011
    Nov 24 '18 at 10:18
















0















I begin by saying that this is not an issue with environment variables.



When I use the header only libraries everything works fine with this:



set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED)

if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(TestCMake Program.cpp)
target_link_libraries(TestCMake ${Boost_LIBRARIES})
endif()


But when I try to require a library by changing find_package(Boost REQUIRED) to find_package(Boost REQUIRED COMPONENTS system) I get an error:



Unable to find the requested Boost libraries.

Boost version: 1.67.0

Boost include path: D:/boost/boost_1_67_0

Could not find the following Boost libraries:

boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.


This answer on another question suggests that CMake expects the Boost binaries to be named in a certain way:



boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread


I have a precompiled binary (acquired from here) named boost_system-vc141-mt-x32-1_67.lib. How could I make CMake recognize the naming convention used in my binaries?



Comments to this downvoted answer on that other question suggest against renaming the files.










share|improve this question




















  • 2





    Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

    – Matthieu Brucher
    Nov 24 '18 at 10:08











  • Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

    – user3670011
    Nov 24 '18 at 10:18














0












0








0


1






I begin by saying that this is not an issue with environment variables.



When I use the header only libraries everything works fine with this:



set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED)

if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(TestCMake Program.cpp)
target_link_libraries(TestCMake ${Boost_LIBRARIES})
endif()


But when I try to require a library by changing find_package(Boost REQUIRED) to find_package(Boost REQUIRED COMPONENTS system) I get an error:



Unable to find the requested Boost libraries.

Boost version: 1.67.0

Boost include path: D:/boost/boost_1_67_0

Could not find the following Boost libraries:

boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.


This answer on another question suggests that CMake expects the Boost binaries to be named in a certain way:



boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread


I have a precompiled binary (acquired from here) named boost_system-vc141-mt-x32-1_67.lib. How could I make CMake recognize the naming convention used in my binaries?



Comments to this downvoted answer on that other question suggest against renaming the files.










share|improve this question
















I begin by saying that this is not an issue with environment variables.



When I use the header only libraries everything works fine with this:



set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost REQUIRED)

if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(TestCMake Program.cpp)
target_link_libraries(TestCMake ${Boost_LIBRARIES})
endif()


But when I try to require a library by changing find_package(Boost REQUIRED) to find_package(Boost REQUIRED COMPONENTS system) I get an error:



Unable to find the requested Boost libraries.

Boost version: 1.67.0

Boost include path: D:/boost/boost_1_67_0

Could not find the following Boost libraries:

boost_system

No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.


This answer on another question suggests that CMake expects the Boost binaries to be named in a certain way:



boost_thread-vc100-mt-1_51
boost_thread-vc100-mt
boost_thread-mt-1_51
boost_thread-mt
boost_thread


I have a precompiled binary (acquired from here) named boost_system-vc141-mt-x32-1_67.lib. How could I make CMake recognize the naming convention used in my binaries?



Comments to this downvoted answer on that other question suggest against renaming the files.







c++ boost cmake






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '18 at 10:23









Matthieu Brucher

16k32141




16k32141










asked Nov 24 '18 at 10:07









user3670011user3670011

898




898








  • 2





    Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

    – Matthieu Brucher
    Nov 24 '18 at 10:08











  • Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

    – user3670011
    Nov 24 '18 at 10:18














  • 2





    Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

    – Matthieu Brucher
    Nov 24 '18 at 10:08











  • Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

    – user3670011
    Nov 24 '18 at 10:18








2




2





Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

– Matthieu Brucher
Nov 24 '18 at 10:08





Which CMake version are you using? Only after 3.11 does CMake support the new Boost naming convention. You can also use a more recent FindBoost in your project, that works as well. No need to rename anything.

– Matthieu Brucher
Nov 24 '18 at 10:08













Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

– user3670011
Nov 24 '18 at 10:18





Oh wow, I'm actually using 3.10. I feel so stupid now for wasting over 2 hours on this already.

– user3670011
Nov 24 '18 at 10:18












1 Answer
1






active

oldest

votes


















2














In newer Boost (1.66 and forward), the naming convention of the binaries has changed. Now, there is an additional x64 or x32.



As such, only CMake version posterior to the 1.66 Boost release have this fix, which is the case starting at 3.11.



So two options for you:




  • Upgrade your CMake version to something above 3.11

  • Use the FindBoost.cmake from one of these newer CMake versions (they usually are compatible).


The latter solution would have to be used if you are "stuck" with one version due to company policies.






share|improve this answer
























  • It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

    – jaskmar
    Feb 21 at 14:36











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457094%2fcmake-not-finding-boost-library-binaries-new-naming-convention-for-the-binaries%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














In newer Boost (1.66 and forward), the naming convention of the binaries has changed. Now, there is an additional x64 or x32.



As such, only CMake version posterior to the 1.66 Boost release have this fix, which is the case starting at 3.11.



So two options for you:




  • Upgrade your CMake version to something above 3.11

  • Use the FindBoost.cmake from one of these newer CMake versions (they usually are compatible).


The latter solution would have to be used if you are "stuck" with one version due to company policies.






share|improve this answer
























  • It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

    – jaskmar
    Feb 21 at 14:36
















2














In newer Boost (1.66 and forward), the naming convention of the binaries has changed. Now, there is an additional x64 or x32.



As such, only CMake version posterior to the 1.66 Boost release have this fix, which is the case starting at 3.11.



So two options for you:




  • Upgrade your CMake version to something above 3.11

  • Use the FindBoost.cmake from one of these newer CMake versions (they usually are compatible).


The latter solution would have to be used if you are "stuck" with one version due to company policies.






share|improve this answer
























  • It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

    – jaskmar
    Feb 21 at 14:36














2












2








2







In newer Boost (1.66 and forward), the naming convention of the binaries has changed. Now, there is an additional x64 or x32.



As such, only CMake version posterior to the 1.66 Boost release have this fix, which is the case starting at 3.11.



So two options for you:




  • Upgrade your CMake version to something above 3.11

  • Use the FindBoost.cmake from one of these newer CMake versions (they usually are compatible).


The latter solution would have to be used if you are "stuck" with one version due to company policies.






share|improve this answer













In newer Boost (1.66 and forward), the naming convention of the binaries has changed. Now, there is an additional x64 or x32.



As such, only CMake version posterior to the 1.66 Boost release have this fix, which is the case starting at 3.11.



So two options for you:




  • Upgrade your CMake version to something above 3.11

  • Use the FindBoost.cmake from one of these newer CMake versions (they usually are compatible).


The latter solution would have to be used if you are "stuck" with one version due to company policies.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 24 '18 at 10:21









Matthieu BrucherMatthieu Brucher

16k32141




16k32141













  • It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

    – jaskmar
    Feb 21 at 14:36



















  • It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

    – jaskmar
    Feb 21 at 14:36

















It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

– jaskmar
Feb 21 at 14:36





It doesn't work in 3.12. [ C:/Program Files/CMake/share/cmake-3.12/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: libboost_system-mgw73-mt-d-1_68;libboost_system-mgw73-mt-d;libboost_system-mt-d-1_68;libboost_system-mt-d;libboost_system-mt;libboost_system;libboost_system-mgw73-mt-s-d-1_68;libboost_system-mgw73-mt-s-d;libboost_system-mt-s-d-1_68;libboost_system-mt-s-d

– jaskmar
Feb 21 at 14:36




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53457094%2fcmake-not-finding-boost-library-binaries-new-naming-convention-for-the-binaries%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen