设置在升压克利翁 [英] Setup Boost in Clion

查看:132
本文介绍了设置在升压克利翁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用加速库与克利翁MinGW的?我已经下载并解压 boost_1_60_0.zip C:\\ boost_1_60_0 。那我现在该怎么办?我一定要安装的东西?这里是我的的CMakeLists.txt

  cmake_minimum_required(3.3版本)
项目(server_client)集(CMAKE_CXX_FLAGS$ {} CMAKE_CXX_FLAGS -std = C ++ 11 -s -O3)
集(CMAKE_EXE_LINKER_FLAGS -static)集(BOOST_ROOTC:/ boost_1_60_0)
集(BOOSTROOTC:/ boost_1_60_0)
find_package(升压1.60.0)
如果(不Boost_FOUND)
    消息(是fatal_error找不到提升!)
万一()集(SOURCE_FILES chat_server.cpp)
add_executable(server_client $ {} SOURCE_FILES)

找不到加速

1


解决方案

  1. 首先,您必须开始使用升压。由于 Boost.Asio的是不是一个只有头库,您必须确保该库是正确的打造


  2. 然后你必须配置克利翁承担的头和库正确的道路。一种解决的第二个问题可以在此<一个发现href=\"http://stackoverflow.com/questions/28761323/how-to-include-external-library-boost-into-clion-c-project-with-cmake\">SO问题。


How to use Boost library in Clion with MinGW ? I have downloaded and unzipped boost_1_60_0.zip to C:\boost_1_60_0. What am I supposed to do now ? Do I have to install something ? Here is my CMakeLists.txt:

cmake_minimum_required(VERSION 3.3)
project(server_client)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s -O3")
set(CMAKE_EXE_LINKER_FLAGS -static)

set(BOOST_ROOT "C:/boost_1_60_0")
set(BOOSTROOT "C:/boost_1_60_0")
find_package(Boost 1.60.0)
if(NOT Boost_FOUND)
    message(FATAL_ERROR "Could not find boost!")
endif()

set(SOURCE_FILES chat_server.cpp)
add_executable(server_client ${SOURCE_FILES})

Can not find Boost:

解决方案

  1. First you must get started with boost. As boost.asio is not a header-only library, you must be sure that the library was properly build.

  2. Then you have to configure CLion to take the right path for the headers and the library. A solution to this second question can be found on this SO question.

这篇关于设置在升压克利翁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆