#newbie issue with installing boost on win 11 clion

4 messages · Page 1 of 1 (latest)

pseudo charm
#
 The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    C:\Program Files\boost

The following directory should be added to linker library paths:

    C:\Program Files\boost\stage\lib

updated my cmake with gpt

#cmake_minimum_required(VERSION 3.28)
#project(cppscratchclion)
#
#set(CMAKE_CXX_STANDARD 17)
#
#add_executable(cppscratchclion main.cpp
#        ctester.c)

cmake_minimum_required(VERSION 3.28)
project(cppscratchclion)

set(CMAKE_CXX_STANDARD 17)

# Specify the path to the Boost root directory
set(BOOST_ROOT "C:/Program Files/boost")
set(BOOST_INCLUDEDIR "C:/Program Files/boost")
set(BOOST_LIBRARYDIR "C:/Program Files/boost/stage/lib")

# Specify which Boost libraries you need
find_package(Boost 1.86.0 REQUIRED COMPONENTS filesystem system)

if (Boost_FOUND)
    message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
    include_directories(${Boost_INCLUDE_DIRS})
    link_directories(${Boost_LIBRARY_DIRS})
else()
    message(FATAL_ERROR "Could not find Boost!")
endif()

add_executable(cppscratchclion main.cpp ctester.c)

# Link Boost libraries to your target
target_link_libraries(cppscratchclion ${Boost_LIBRARIES})

but i am getting the error

shy bridgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

pseudo charm
#

working cmake

cmake_minimum_required(VERSION 3.28)
project(cppscratchclion)

set(CMAKE_CXX_STANDARD 17)
find_package(Boost REQUIRED)
include_directories(Boost "C:/Program Files/boost")

add_executable(cppscratchclion main.cpp
        ctester.c)

#

!solved