wfjohns1
wfjohns1

Reputation: 31

Error with Boost Filesystem Version in Cmake

I'm working on a c++ program that uses cmake with conan to compile, and boost 1.7.4. Recently, I started getting: error: #error Compiling Filesystem version 3 file with BOOST_FILESYSTEM_VERSION defined != 3.

The program was working fine up until recently, and now just started getting this error.

Here's my cmake code

#find external libraries with Conan
 ----------------------------------------------------------
conan_check(VERSION 1.0.0 REQUIRED)
message(STATUS "Downloading dependency libraries with Conan")

 #The boost dependency is tricky.
 #Need 1.74 for correct behavior, and need options to successfully build on mac
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     #workaround for https://github.com/conan-io/conan-center-index/issues/4097
    set(CONAN_OPTIONS boost:without_fiber=True boost:without_nowide=True)
else()
    set(CONAN_OPTIONS )
endif()

conan_cmake_run(REQUIRES boost/1.74.0 jsoncpp/[>=1.8.4] eigen/[>=3.3.7] cgal/[>=5.1]
    OPTIONS
        ${CONAN_OPTIONS}
    BUILD missing
    CMAKE_TARGETS
    BASIC_SETUP
    UPDATE)

I believe boost 1.7.4 only supports filesystem v3, is there a way to check my Boost file system version? Any potential fixes would be greatly appreciated.

Upvotes: 3

Views: 612

Answers (1)

Nick Monkman
Nick Monkman

Reputation: 637

We're having the same issue. I fixed it (locally) by adding

'boost:filesystem_version = 3'

to our conanfile.py's default options {}. Looks like this recent change to the recipe is the culprit: https://github.com/conan-io/conan-center-index/pull/11988

Upvotes: 5

Related Questions