简体   繁体   English

Visual Studio 2010中的源目录

[英]Source directories in Visual Studio 2010

I am using OF in my project and I want to use some add-ons but I have to add .cpp files to my project in order to compile them. 我在我的项目中使用OF,我想使用一些附加组件,但我必须将.cpp文件添加到我的项目中才能编译它们。 I don't like it. 我不喜欢它。 Is there any option so I could specify a folder to scan for source files and compile every .cpp file it finds? 有没有选项,所以我可以指定一个文件夹来扫描源文件并编译它找到的每个.cpp文件?

I thought it might be Source Directories in VC++ Directories section but it didn't work. 我认为它可能是VC ++目录部分中的源目录,但它不起作用。 Then I don't really get what it does. 然后我真的不知道它做了什么。

If you want to compile sources using Visual Studio, you will have to add them to your project. 如果要使用Visual Studio编译源,则必须将它们添加到项目中。 There is nothing wrong about adding external sources to your project in a nice filter. 在一个漂亮的过滤器中将外部源添加到项目中没有任何问题。

You can also create a makefile to be used by Visual Studio which will list sources you need. 您还可以创建Visual Studio使用的makefile,它将列出您需要的源。

I'm not aware of an option that does what you ask for in VS. 我不知道有一个选项可以满足你在VS中的要求。 The Source directories configuration is used for locating source files that go along with libraries that you are using in your project. 源目录配置用于查找与您在项目中使用的库一起提供的源文件。 This way you can use the library in its binary format without the need to recompile it every time you rebuild your project, but you can also step into its code while debugging. 这样,您可以以二进制格式使用库,而无需在每次重建项目时重新编译它,但您也可以在调试时进入其代码。

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

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