包括C ++源代码相关Boost库(使用Visual Studio) [英] Including Relevant Boost Libraries with C++ Source (Using Visual Studio)

查看:91
本文介绍了包括C ++源代码相关Boost库(使用Visual Studio)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我挖成的解决方案Boost库的一个项目我工作(学校)。我需要一些方法来与我的应用程序分发所需的升压源$ C ​​$ C,这样它可以在不安装的系统做编译的库进行编译。 (学校计算机缺乏公正的东西,那么你可以说,这所学校刚刚安装CVS去年,但他们也有VS2005)

I have a project I'm working on (for school) that I'm digging into the Boost libraries for the solutions. I need some way to distribute the required Boost source code with my application so that it can be compiled without the libraries being installed on the system doing the compiling. (School computers lack just about anything you can mention. The school just installed CVS last year. But they do have VS2005)

请注意:我使用Visual Studio 2005在Vista上。我有升压1.34.1我的系统我用href=\"http://www.boostpro.com/products/free\" rel=\"nofollow\">自动安装的

Note: I'm using Visual Studio 2005 on Vista. I have Boost 1.34.1 on my system I used the automatic installer. The documentation I've come across says something about using BCP command but that command doesn't seem to copy anything. (I'm using absolute path to call BCP so I don't end up calling the wrong command.)

编辑:我试图用正则表达式库

I am trying to use the RegEx libraries.

编辑:我使用BCP的命令是:C:\\ Program Files文件\\提升\\ boost_1_34_1 \\ BIN \\的Bcp.exe助推/ regex.hpp正则表达式\\

The command I'm using for BCP is: "c:\Program Files\boost\boost_1_34_1\bin\bcp.exe" boost/regex.hpp regex\

和它返回:没有检测到错误

推荐答案

这取决于你使用的库。如果您使用的是只有头库(大部分Boost库是,一些值得注意的例外是信号,串行和日期/时间),你可以复制的头文件。否则,你就需要复制cpp文件也。我的建议是只包括他们到您的项目。

It depends on the library you're using. If you're using a header-only library (most of the boost libraries are, some notable exceptions are signals, serialisation and date/time) you can just copy those header files. Otherwise you'll need to copy the cpp files, too. My suggestion is to just include them into your project.

所以,在这里就是你要做的:您删除升压包括项目设置(工具 - >选项 - >项目和解决方案 - > VC ++ directories->包含文件)路径。尝试编译。看看其中包括失败。从升压目录中的文件复制到你的项目目录。车床,冲洗,重复,直到你的项目编译。

So, here's what you do: you remove the boost include path from your project settings (tool->options->projects and solutions->vc++ directories->include files). Try to compile. Look at which include fails. Copy that file from your boost directory to your project directory. Lather, rinse, repeat until your project compiles.

如果您使用的是需要.cpp文件库中,您将获得在链接时出现错误。您使用图书馆的所有.cpp文件复制到您的项目目录,并将它们都添加到您的解决方案。重建和交叉手指。

If you're using a library that requires .cpp files, you'll get an error at link time. Copy all .cpp files of the library you use to your project directory and add them all to your solution. Rebuild and cross fingers.

有关更详细的回答,请发表你使用的库。

For a more detailed answer, please post which libraries you're using.

这篇关于包括C ++源代码相关Boost库(使用Visual Studio)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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