Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8633403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:29:08+00:00 2026-06-12T09:29:08+00:00

I have compiled Boost 1.51.0 on Windows using the rubenvb ‘s CLang build. I

  • 0

I have compiled Boost 1.51.0 on Windows using the rubenvb‘s CLang build. I actually compiled b2 using MinGW:

bootstrap mingw
... compiling b2 using mingw...

and then I compiled the libraries with CLang:

b2 toolset=clang stage --stagedir=. --build-type=complete --with-regex ...

By the way, even if I specified --build-type=complete there are no DLLs in lib directory, but I read somewhere that CLang has still problem with linking on Windows so that might be the reason. Anyway static libraries are fine for me. I got these files in %BOOST_ROOT%\lib:

libboost_regex-clang31-1_51.lib
libboost_regex-clang31-d-1_51.lib
libboost_regex-clang31-mt-1_51.lib
libboost_regex-clang31-mt-d-1_51.lib
libboost_regex-clang31-mt-s-1_51.lib
libboost_regex-clang31-mt-sd-1_51.lib
libboost_regex-clang31-s-1_51.lib
libboost_regex-clang31-sd-1_51.lib

Now, if I compile something with CLang from command line everything works. The problem shows when I try to make CMake find Boost libraries: it simply could not find them. I tried with this CMakeFiles.txt:

cmake_minimum_required (VERSION 2.8)
project(ccc)

# Setting/unsetting this does not change anything.
set(Boost_USE_STATIC_LIBS ON)

find_package(Boost COMPONENTS regex REQUIRED)

include_directories(${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIRS})

add_executable(ccc main.cpp)

target_link_libraries(ccc
    ${Boost_REGEX_LIBRARY}
    )

Building it using MinGW (and a MinGW compiled version of Boost) it works. If I try with CLang (after having setted CC=clang, CXX=clang++ and BOOST_ROOT=C:/misc/boost/clang-1_51_0) it does not:

D:\Desktop\ppp>cmake -G "MinGW Makefiles" ..\ccc
-- The C compiler identification is Clang 3.1.0
-- The CXX compiler identification is Clang 3.1.0
-- Check for working C compiler: C:/misc/clang/bin/clang.exe
-- Check for working C compiler: C:/misc/clang/bin/clang.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/misc/clang/bin/clang++.exe
-- Check for working CXX compiler: C:/misc/clang/bin/clang++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/misc/cmake/share/cmake-2.8/Modules/FindBoost.cmake:1191 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.51.0

  Boost include path: C:/misc/boost/clang-1_51_0

  The following Boost libraries could not be found:

          boost_regex

  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.
Call Stack (most recent call first):
  CMakeLists.txt:5 (find_package)


CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_REGEX_LIBRARY (ADVANCED)
    linked by target "ccc" in directory D:/Desktop/ccc

-- Configuring incomplete, errors occurred!

However, if I compile manually it works again:

clang++ main.cpp -I%BOOST_ROOT% -L%BOOST_ROOT%\lib -llibboost_regex-clang31-1_51
...Ok, and the executable works

Manually setting BOOST_LIBRARYDIR does not work either. Neither does using backslashes \.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:29:09+00:00Added an answer on June 12, 2026 at 9:29 am

    Looking inside the file “C:/misc/cmake/share/cmake-2.8/Modules/FindBoost.cmake” you can find a list of all the variables related to Boost you can use. The one you need is Boost_COMPILER (Boost_DETAILED_FAILURE_MSG can also be useful to diagnose problems):

    #   Boost_COMPILER               Set this to the compiler suffix used by Boost
    #                                (e.g. "-gcc43") if FindBoost has problems finding
    #                                the proper Boost installation
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started with using boost libraries. For one of our projects i
I'm trying to build boost on windows 7 64-bits. Running bootstrap gives execnt.c(29) :
I've been using boost under windows for a while, and now have a need
I have compiled part of boost - the ibeta_inv function - into a .Net
I have compiled a .NET application using Any CPU option. This .NET application uses
I have compiled the NTL inifite precision integer arithmetic library for c++, using Microsoft
I have compiled my application on Linux (Intel) machine using this command gcc –g
I have compiled an Ada program on Ubuntu using GNAT. Afterwards, I tried a
I have compiled this using Visual Studio 2010 compiler and it has compiler error
I have compiled and created .WAR file of my java code. then i started

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.