VS 2012与C ++组include / lib [英] VS 2012 with C++ group include/lib
问题描述
我目前正在与一位朋友合作一个大型项目,现在是我们开始处理相同文件的时候了。我们有一个dropbox,我们想知道是否有一些方法配置项目,所有必要的额外包括/ .libs为我们正在使用的库,所以如果我们更改库或其他人不必有
例如,他在 OpenGL 中工作,我使用 和其他图书馆。是否有某种方法将所有这些组合到收存箱文件夹 中,并让这些项目链接/编译出来?
是的,VS2010有大量的超级有用的宏内置的项目共享。
- 在您的项目中创建
外部
文件夹以保存您将使用的所有库 - 所有include / lib目录都应使用SolutionDir宏,作为一个例子,我的一个额外的包括目录是
$(SolutionDir)\external \glew-1.9.0\include
SolutionDir 宏仅仅是解决方案的位置相对于计算机。这意味着两台计算机可能有完全不同的路径到解决方案,但宏正确告诉编译器在哪里找到 \external\libraryFile\include
这里有一个图片试图让它更清楚:
有人可以阅读的更大的版本
>
编辑:VS有许多其他有用的宏,如果你不想它在解决方案中查找VS提供的其他目录选项。
I am currently working on a large project with a friend and it's time we started working on the same files. We have a dropbox, and we're wondering if there was some way to configure the project so all necessary extra includes/.libs for the libraries we are using in there, so if we change libraries or whatever the other won't have to go download and install anything.
For example, he's working in OpenGL and I'm working with Lua and other libraries. Is there some way to combine all these into dropbox folders and have the project link/compile out of those?
Yes, VS2010 has a wide array of super useful macros built in for project sharing.
- Create an
external
folder in your project to hold all libraries you'll be using - All of your include/lib directories should use a SolutionDir macro, as an example one of my additional include directories is
$(SolutionDir)\external\glew-1.9.0\include
The SolutionDir macro is simply the location of the solution relative to the computer. This means two computers could have completely different paths to the solution, but the macro correctly tells the compiler where to find \external\libraryFile\include
Here's an image in an attempt to make it more clear: A larger version someone can actually read
edit: VS has many other useful macros out there, if you do not want it specifically in the solution look into other directory options VS provides.
这篇关于VS 2012与C ++组include / lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!