BOOST 库 c++ 的问题

发布于 2025-01-06 06:48:03 字数 451 浏览 0 评论 0原文

我想在 Linux 上的 emacs 中做的 C++ 项目中使用 boost 库,但我在让它工作时遇到了麻烦。我不想将其实际安装在我的机器上。我希望能够使用 boost 的正则表达式部分。我希望能够打包我的源文件并将它们发送到另一台计算机(这可能没有安装 boost,我也无法安装它)并能够编译我的项目。我尝试使用 regex 文件夹中的 make 文件并创建了 .a 和 .so,但是在链接库并将包含设置到 boost 文件夹时无法编译它(我已经尝试了boost 目录也是如此——其中许多是 Google 推荐的,但无济于事)。我不断收到“找不到 regex/config.hpp”错误。

无论如何,是否可以将所有内容都包含在一个文件(例如 .so 或 .a)中并使其以这种方式工作?我也可以包含 regex 文件夹本身,但是...

如果我这样做,我是否必须将整个 boost 文件夹包含在我的项目中?这可能是可行的,但我不希望我的 tar 文件那么大。

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. I don't want to actually install it on my machine. I want to be able to use the regex part of 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. 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). I keep getting a "cannot find regex/config.hpp" error.

Is there anyway to include everything in one file like a .so or .a and get it to work this way? I am okay with including the regex folder itself as well, butt...

If I were to do it this way would I have to include the whole boost folder with my project anyway? That might be doable, but I don't want my tar file to be that big.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦言归人 2025-01-13 06:48:03

为什么不直接将 boost 列为依赖项并让用户安装它?
如果没有,请使用 Boost bcp 将正则表达式及其依赖项提取到独立库。

why not just listing boost as a dependencies and let user install it ?
If not, use Boost bcp to extract regex and its dependencies to a standalone library.

緦唸λ蓇 2025-01-13 06:48:03

At first you need to build regex library in boost. Without this library you can't use
boost.regex.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文