[CMake] Can't find boost libs on VS2017 CMake 3.12

Sophonet cmake at kant.sophonet.de
Thu Aug 2 16:34:15 EDT 2018


One hint would be to SET(Boost_DEBUG ON) and to watch the output of the cmake call. There, you can check the names of the libraries that CMake is looking for.

On Windows, the new boost versions add a suffix fo x64/x86 to their library name.

Can you confirm that the library names that Boost_DEBUG report are the ones that cover your compiled library? If not, then I would think that CMake ist not yet able to find new boost libraries due to the x86/64 sufffix - but again, please check if this applies to your version numbers…


> Am 02.08.2018 um 22:24 schrieb Michael Ellery <mellery451 at gmail.com>:
> 
> did you build boost yourself or download a pre-built package? What subdirectory are the import libraries (.lib) located in? Do you set any boost-finder variables before calling find_package(Boost)? I have at times in the past had to set BOOST_LIBRARYDIR when the package I was using had an odd lib file location, but I don’t think that’s typically needed.
> 
> 
>> On Aug 2, 2018, at 6:24 AM, Søren <sd at syntonetic.com> wrote:
>> 
>> Dear cmake community
>> 
>> I can't make CMake find the built boost libraries on Windows. At this line:
>> 
>>    find_package(Boost REQUIRED COMPONENTS thread)
>> 
>> I get this error message:
>> "Unable to find the requested Boost libraries.
>> 
>>  Boost version: 1.67.0
>> 
>>  Boost include path: C:/download/boost/boost_1_67_0
>> 
>>  Could not find the following static Boost libraries:
>> 
>>          boost_thread
>> 
>>  Some (but not all) of the required Boost libraries were found. You may
>>  need to install these additional Boost libraries.  Alternatively, set
>>  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
>>  to the location of Boost."
>> 
>> Other facts and observations:
>> * Error both observed with stand alone Cmake 3.12, and the version cmake 3.11 that ships with VS2017.
>> * VS2017 version 15.7.5 (currently the latest)
>> * The same error with older Boost versions 1.65.x or 1.66
>> * Building and linking the same program using VS2017 without cmake works fine.
>> * It's not only threat that has the problem. Tested also date_time and chrono with same errors.
>> * Building a program with cmake that only requires boost headers-only-libs works fine.
>> * Building the same project on linux works fine.
>> 
>> Any ideas?
>> Thanks in advance
>> Soren
>> 
>> --
>> 
>> Powered by www.kitware.com
>> 
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>> 
>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>> 
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>> 
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>> 
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
> 
> -- 
> 
> Powered by www.kitware.com
> 
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
> 
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
> 
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list