我应该将第三方库放在哪里? [英] Where should I put third-party libraries?

查看:206
本文介绍了我应该将第三方库放在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为具有大量依赖关系的体面的C ++项目做出贡献。问题是,项目包含所有依赖的源(例如pcre,zlib等)。我想修剪项目,只是与程序本身相关。有没有一些相对标准的方法来编译这些库并将它们放在某个地方,并且它们的头文件也很容易访问?

I contribute to a decent-sized C++ project with a number of dependencies. The problem is, the project contains the source of all of its dependencies (e.g. pcre, zlib, etc.). I want to trim the project down to just what's relevant to the program itself. Is there some relatively standard way to compile these libraries and put them somewhere, and have their header files also easily accessible?

对于什么值得使用Windows 7 ,我正在开发使用VS2005。我也是一个完整的noob与在Windows上的大型C ++项目;我从来没有真正需要超越标准库和win32。

For what it's worth, I'm using Windows 7, and I'm developing using VS2005. I'm also a complete noob with working on large C++ projects on Windows; I've never really needed to step outside the standard library and win32.

推荐答案

我在工作场所使用的结构是一个外部文件夹,其中包含头文件和外部Libs的Include和Lib文件夹。然而,由于我们也使用VS,我们尽量使用其依赖功能,删除手动输入到链接器。这意味着只有不在同一解决方案下的项目才会转到外部文件夹。此外,由于我们有一些特定于某些项目的第三方库,我们在项目文件夹中创建这些includes和libs的文件夹。这是它得到的:

A structure that we use on my workplace is having one "External" folder that contains an "Include" and a "Lib" folder for the headers and external Libs. However, as we also use VS, we try to use its "Dependencies" feature as most as possible, removing manual inputs to the linker. That means only projects that are not under the same solution goes to the "External" folder. Also, as we have some third-party libraries specific to some projects, we create folders inside the project folder for these includes and libs. This is how it gets:


.\
|-Project1\ --> contains Project1.vcproj
|-Project2\ --> contains Project2.vcproj
| |-Third-Party\
|   |-Include\
|   |-Lib\
|-External\
| |-Include\
| |-Lib\
|-InternalLibrary\ --> contains InternalLibrary.vcproj
|-Solution.sln --> includes the vcproj's and link them as necessary by its dependencies
I can't tell if this is the best structure ever, but everything is under source control, we can do night builds just by building the solution, and development goes by building single projects.

这篇关于我应该将第三方库放在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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