Can't find boost libs on VS2017 CMake 3.12

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't find boost libs on VS2017 CMake 3.12

Søren
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
Reply | Threaded
Open this post in threaded view
|

Re: Can't find boost libs on VS2017 CMake 3.12

Michael Ellery
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 <[hidden email]> 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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can't find boost libs on VS2017 CMake 3.12

Sophonet
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 <[hidden email]>:
>
> 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 <[hidden email]> 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

--

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
Reply | Threaded
Open this post in threaded view
|

Re: Can't find boost libs on VS2017 CMake 3.12

Søren
Thanks

Debug output shows
* that it already searchs in the right folders.
* It appears to search for the right patterns e.g.
"boost_chrono-vc141-mt-x64-1_67" (file is there
"libboost_chrono-vc141-mt-x64-1_67.lib")
* It also states  "Boost_FOUND = 1"

But still that error. So far I can't see from the debug output why it
fails.
--

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
Reply | Threaded
Open this post in threaded view
|

Re: Can't find boost libs on VS2017 CMake 3.12

Søren
Update: I put this before find packages boost and now it WORKS:

if (WIN32)
  set (Boost_USE_STATIC_LIBS ON)
endif (WIN32)

Think I tried this earlier with no luck but it may have been obscured by cache or some other attempts.

On 03-08-2018 13:24, Søren wrote:
Thanks

Debug output shows
* that it already searchs in the right folders.
* It appears to search for the right patterns e.g. "boost_chrono-vc141-mt-x64-1_67" (file is there "libboost_chrono-vc141-mt-x64-1_67.lib")
* It also states  "Boost_FOUND = 1"

But still that error. So far I can't see from the debug output why it fails.

--

Best regards,

Søren Dyrsting

Senior Software Engineer

cid:image001.png@01D38889.00F59D30

T: +45 36 16 36 00


--

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