hi folks sorry to buggy you but i tried several type of project, and never have the C++ pre compiler options in the properties of my project,
i have already a .cpp program loaded, but there is no mention of "C++" in the project properties left pane
In solution explorer, with your solution loaded, you'll see the projects that form your solution. (In my example I created a new C++ Console Application)
If you select your c++ project in the 'Solution Explorer' window, right-click, in the context menu towards the bottom there will be an option for "Properties".
This will open up the project properties, and in that dialog is a section for C/C++ under 'Configuration Properties'.
There you will find all the C++ options that you need.
I'm in the process of refactoring a project. I've got an entire subfolder which is known to be broken. Is there any declarative way to exclude that folder from the compile temporarily while I test the refactoring thus far?
I realize I could delete the folder, but I'd like to do this through configuration if possible.
You could set the Build Action (in the Properties Window) to None for the files you want excluded. You could also right-click on the folder and choose Exclude from Project.
In VS 2010, right-click on the CPP module, choose Properties.
Then click on Configuration Properties -> General, Exclude from Build = Yes.
"Exclude from Project" is no good, it disappears from the other Configurations as well.
Right click all the files, and select Properties. Now set Action to None. Revert to Compile when you fixed the code :)
Use ExcludeFoldersFromDeployment inside <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> tag, example:
<ExcludeFoldersFromDeployment>FolderToExclude</ExcludeFoldersFromDeployment>
For files, use:
<ExcludeFilesFromDeployment>File1.aspx;File2.aspx</ExcludeFilesFromDeployment>
Select the files that you don't want to have compiled on the Solution Explorer.
Right click and choose Options...
Set the "Build Action" on the files to "None".
That should do the trick for you!
On Visual studio 2010 or later, you can achieve the functionality in two ways.
Right click the file, select 'Exclude From Project'
Right click the file, select 'Properties' --> select 'Configuration Properties' --> select 'General' --> choose 'Yes' from drop down menu for option 'Excluded From Build'
You should just be able to right click on the folder name in your solution explorer, and click "exclude from project".
In a website project type, you can set the files/folders attributes to "hidden" in Explorer to achieve the same effect.
If you have a lot of image files in a folder, so many that compilation is a painfully long task; you can rename the folder in IIS, giving the folder a .exclude extension.
e.g. C:\intetpub\wwwroot\yoursite\images change to C:\intetpub\wwwroot\yoursite\images.exclude
Then when you compile your app, the .exclude folder is excluded from compilation.
This is a method I have found for IIS Website Projects.
Set the "Hidden" attribute for the file/folder which you want to exclude from project, and then refresh the project in Solution Explorer. For example:
1. Open Windows Explorer.
2. Go to the physical folder of your website.
3. Right click the file/folder which you want to exclude, and then select "Properties".
4. Check the "Hidden" attribute.
5. Click the "Refresh" button in the Visual Studio Solution Explorer
Benson Yu
Microsoft Online Community Support
Quoted from: https://forums.asp.net/post/1997766.aspx
I'm quite sure that there should be a "Exclude from build" property on the folder, but I don't have my Visual Studio with me at the moment. At the very least there is such a property on files.
In Rider, right click file in Navigation Bar, click Properties, change Build action to None.
In Visual Studio 2010 you need to right click the project in the Solution Explorer and choose Unload Project
I have a very specific question in regards to visual C++ 2010 express. I have looked everywhere but can't find instructions on how to compile several source files. I have programmed on Unix at the command line and am trying to learn visual C++ 2010. I am using a header file that contains the function declarations and global variables. I don't know if this is the correct venue to ask this question but if anyone knows of some place where I can get the answer I would be grateful
Thanks,
Ral
If you have a project that you build from the command line with a makefile, then the Visual Studio development environment will not recognize your project. To open and build your project using Visual Studio, first create an empty project containing the appropriate build settings using the Makefile Project Wizard. You can then use this project to build your project from the Visual Studio development environment.
The project displays no files in Solution Explorer. The project specifies the build settings, which are reflected in the project's property page.
The output file that you specify in the project has no effect on the name that the build script generates; it declares only an intention.
Source: Creating a Makefile Project (VS2013)
On the menu: File->New->Project
On the dialog:
select Win32 Console Application,
enter Name ( like you did in the -o in unix) in the bottom,
and press OK
On the next dialog: Press next.
On the next dialog:
unmark Precompiled headers
mark Empty project
press Finish
Now find the Solution Explorer tree. You have Solution name and a project with the same name in it.
Right click on the project (not solution)
choose Add->Existing Item
and select your files, (you can copy them to the opened folder and then choose them)
press Add
Now you can try to compile.
I'm using Visual Studio Express 2013 and trying to compile someone else's code. The documentation tells me to set the environment variable QTDIR in the command line and then launch VS from that terminal. But the compiler still thinks QTDIR is what it originally was instead of what I specified in the command line.
I've tried to restart the computer and do it again, but the result didn't change. I looked into the project properties, but found nothing that seems to be overriding this variable. And when I clicked the "Macros>>" button in dialogs such as the editing additional include directories dialog, it says QTDIR is what it was originally. (Weirdly: this happens only to one project in the solution; when I opened the Macros>> from other projects, QTDIR is what I specified in the command line!)
So I was wondering if there is something that can override an environment variable like this in Visual Studio. Thanks!
Edit: The confusing part is when I looked at the property pages of the projects, under Common Properties >> User Macros and there's nothing defined there.
I can only tell you about VS 2010, but in that one, macros can be defined on a per-project basis in Project Properties > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions. You might look there.
It sounds like there is a user-defined macro for QTDIR in your project that you need to remove.
Try the following:
1) Open your solution in VS2013
2) Open the Property Manager by going to View >> Other Windows >> Property Manager
Now you you'll see a hierarchy of Projects, Configurations, and Property Sheets. The User Macro you need to remove will be set in one of these property sheets (probably the one that ends in .user).
3) Open each property sheet (one at at time!), and find the QTDIR Macro under Common Properties >> User Macros. If it's there, select it and click Remove Macro.
Hope this helps!
Source: http://msdn.microsoft.com/en-us/library/669zx6zc.aspx
I am using visual studio 2010. My code is in C++ and my solution contains many projects and each project again contains multiple folders under it. Whenever I change a file it gets automatically selected in solution explorer as I have enabled the option "Track Active Item in Solution Explorer" in Tools->Options->Projects and Solutions->General. But after changing the file I have to manually select the project (this could be cumbersome as I have to scroll up and down due to many files present) and then right click on it and select "build". Is there any other simple way to do this?
You could assign a shortcut to Build.BuildSelection or Build.BuildOnlyProject
Go to Tools menu, then Options=>Environment=>Keyboard and enter Build.BuildSelection or Build.BuildOnlyProject in the Show commands containing search text area. Then assign two free shortcuts. Build.BuildSelection is for building the current file; Build.BuildOnlyProject will build its project.
I use ctrl-shift+b to build all the solution. I hate to use the mouse for those repetitive tasks.