简体   繁体   English

BOOST库C ++的问题

[英]Problems with BOOST library c++

I want to use the boost library in a c++ project I'm doing in emacs on linux, but I am having troubles getting it to work. 我想在Linux上的emacs中正在使用的c ++项目中使用boost库,但是在使其工作时遇到了麻烦。 I don't want to actually install it on my machine. 我不想在计算机上实际安装它。 I want to be able to use the regex part of boost. 我希望能够使用boost的正则表达式部分。 I want to be able to tar my source files and send them to another computer (that is likely not to have boost installed, nor will I be able to install it) and be able to compile my project. 我希望能够压缩我的源文件并将其发送到另一台计算机(可能没有安装Boost,也无法安装它),并且能够编译我的项目。 I have tried using the make file in the regex folder and made both a .a and .so, but I can't get it to compile when linking the library and setting the includes to the boost folder (I have tried multiple folders in the boost directory as well--many of them recommended by Google, but to no avail). 我尝试使用regex文件夹中的make文件并同时创建了.a和.so,但是在链接库并将includes设置为boost文件夹时,无法将其编译(我尝试了在也提升目录-Google推荐了许多目录,但无济于事。 I keep getting a "cannot find regex/config.hpp" error. 我不断收到“找不到regex / config.hpp”错误。

Is there anyway to include everything in one file like a .so or .a and get it to work this way? 无论如何,是否会将所有内容(例如.so或.a)包含在一个文件中,并使其以这种方式工作? I am okay with including the regex folder itself as well, butt... 我也可以包含regex文件夹本身,但是...

If I were to do it this way would I have to include the whole boost folder with my project anyway? 如果以这种方式进行操作,我是否仍必须在项目中包含整个boost文件夹? That might be doable, but I don't want my tar file to be that big. 那可能是可行的,但是我不希望我的tar文件那么大。

why not just listing boost as a dependencies and let user install it ? 为什么不将boost列为依赖项并让用户安装呢? If not, use Boost bcp to extract regex and its dependencies to a standalone library. 如果不是,请使用Boost bcp将正则表达式及其依赖项提取到独立库中。

At first you need to build regex library in boost. 首先,您需要在boost中构建正则表达式库 Without this library you can't use boost.regex. 没有这个库,您将无法使用boost.regex。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM