im learning boost,i want to link boost_thread.lib,so here are my CMakeLists:
cmake_minimum_required(VERSION 3.19)
project(boost)
set(CMAKE_CXX_STANDARD 20)
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${PROJECT_SOURCE_DIR}/lib)
aux_source_directory(. DIR_SRCS)
add_executable(main ${DIR_SRCS})
target_link_libraries(main boost_thread pthread)
here are myproject structure enter image description here
error:
C:/PROGRA~1/MINGW-~1/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lboost_thread
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [CMakeFiles\main.dir\build.make:105: ../bin/main.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:94: CMakeFiles/main.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:101: CMakeFiles/main.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:136: main] Error 2
where are wrong?thank for help