boost_log
boost_log
CMakeLists
cmake_minimum_required(VERSION 3.23)
project(BOOSTlog)
set(CMAKE_CXX_STANDARD 23)
set(BOOST_ROOT /Users/peiyilin/env/boost_1_80_0)
set(Boost_NO_SYSTEM_PATHS ON)
find_package(Boost COMPONENTS log thread date_time filesystem REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
MESSAGE( STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}.")
MESSAGE( STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}.")
MESSAGE( STATUS "Boost_LIB_VERSION = ${Boost_LIB_VERSION}.")
add_executable(${PROJECT_NAME} main.cpp InitLog.cpp InitLog.h ParseINI.cpp ParseINI.h)
target_link_libraries (${PROJECT_NAME} ${Boost_LIBRARIES})
endif()
set(Boost_NO_SYSTEM_PATHS ON)
是为了设置自定义路径而非默认的盘-DBoost_DEBUG=ON
当cmake找不到boost时可设置编译选项,对应写在cmakelists中是set(Boost_DEBUG ON)
宽字符
现代操作系统中将代码文件和生成文件都指定为utf-8
即可,尽量不要去折腾宽字符和窄字符。
链接错误:error LNK2019
编译完成后在项目中使用时,demo中正常但是在项目中直接调用boost可能会造成链接错误,在csdn中是个付费问题,都是搞技术的,何必相互为难呢。
我尝试了几乎所有我能想到的方法,包括用官方对应版本的二进制文件安装,然后制定include路径和lib路径。重新编译所有lib,都无效。
其实最好的办法是查阅boost官方文档。
- 下载源码
- 编译选项添加该关键字:
define=_WIN32_WINNT=0x0A00
- Enjoy boost!
我是阅读了文档的How to read the documentation章节的Configuring and building the library小节得到答案的,BOOST_USE_WINAPI_VERSION接口中的_WIN32_WINNT
查找对应参数即可。
源码见GitHub
buy clomid online australia At the beginning of the 19th century Christians represented 20 per cent of the population of the Arab world, today two per cent
yoga for high blood pressure pdf Rogge smiled awkwardly, and said to him Your Highness, what was so funny just now cialis from usa pharmacy
I ve got some bad news for you, there is no accepted SARMs dosage that is universally going to work for everyone stromectol side effects