Reset property page settings Visual Studio C 2010 Express - c++

I made some changes to the Property Pages/Configuration Properties a long time ago and I'd like to reset them. I changed stuff like the output directory, code generation settings, etc.
I've tried resetting all environment settings from the Import and Export Settings Wizard. I've also tried the devenv /resetsettings command. Both of which did not work. Reinstalling doesn't work either. May I get some advice on how to restore everything back to the default.
Thank you.

If I understand you correctly, you are trying to revert to old settings for the Project -> Properties.
This information is stored in the project itself, not in Visual Studio. Look for a file with the extension vcxproj in the solution folder.
You can edit it with Notepad (notepad++), or - you can edit it inside Visual Studio, by
right-click the project, unload it, then edit project file, then reload project
Be careful how you edit these settings.
For best results, create a new solution, with a new project, and compare the settings from the newly created project with the existing one.
edit: on my computer (I have VS Ultimate I think, but it shouldn't matter):
To edit, go to Project -> Properties -> VC++ Directories, and on each, at the end of the line, press the arrow down, and click Edit...
VC++ directories:
$(VCInstallDir)bin
$(WindowsSdkDir)bin\NETFX 4.0 Tools
$(WindowsSdkDir)bin
$(VSInstallDir)Common7\Tools\bin
$(VSInstallDir)Common7\tools
Include Directories:
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)include
$(FrameworkSDKDir)\include
from what I see in the directions you pointed out, all you have to do is remove from your list, the directories that you no longer want.
In c/c++ -> Code Generation ->
enable minimal rebuild: NO
enable c++ exceptions: YES (/EHSC)
Basic Runtime Checks - Both
/MTd
...
General -> Output directory:
not sure what is the default, I would put something like
$(SolutionDir)bin\$(Platform)\$(Configuration)\
Also, there seems to be a property sheet that may have been added to your project...
You can generally see the Property Manager from View -> Properties Window (F4).
here, you can expand the project configurations, and simply delete any property sheets you may not want (I expect a new project to have no property sheets).

Related

Where is the "per file" Custom Build Step in Visual Studio 2013?

I have converted my C++ project from Visual Studio 2010 to the 2013 Community edition.
With previous versions I could always right click on a source file and edit a Custom Build step in the properties. Now I can't find the equivalent in VS2013.
The converted project has a Custom Build Step and runs it, but where do I edit it ?
When I open the raw 2013 .vcxproj file, I can see my custom build step as
<CustomBuild Include="foo.h.in">
...
</CustomBuild>
But I don't really want to keep editing my project with a text editor...
Just as harper described. One more thing to add - in VS 2013 and higher they renamed file specific Custom Build Step to Custom Build Tool and its not shown by default. To show it change the Configuration Properties -> General -> Item Type to Custom Build Tool. Apply the changes and 'Custom Build Tool' sub menu will appear.
You find it in the project property pages. Navigate to Configuration Properties -> Custom Build Step -> General.
I had sometimes strange results when converting old projects. I use to create new projects and add the files nowadays what gives better results.

The program file specified in the launch configuration does not exist

I am facing some problems regarding eclipse for c/c++. I am trying to create a new project, I provide the code, and after running the code I get this error:
The program file specified in the launch configuration does not exist
C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found
Please notice that I am working with spice toolkit; I set the path for the "include" files and the libraries, but still I can not have a result.
What causes this error and how can I resolve it?
Right click on your project --> Properties
Run/Debug settings
Delete whatever is set as "launch configuration for '........'
Project --> Clean
Project --> Build Project
You can create a run configuration. Go to Run > Run Configurations. Click New button, fill C/C++ Application field, i.e., insert path to your executable. The new configuration will appear in the list which appears when you click to the arrow next to run button.
Of course this assumes your can build without problems, otherwise you won't see an executable to point to.
You can clean the project, build it again and run it as a local C/C++ application. Simplified steps as follows,
Right click on the project
Clean Project
Again Right click on the project
Build Project
Again Right click on the project
Run As ->
Local C/C++ Application
As the error reads:
C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found
First of all you need to check whether there is an executable "mm.exe" in your Debug folder. (Of course, it is not there and that is why the error)
Go to Project > Clean
and you should see some files being deleted from your Debug folder
Go to Project > Build Project
and you should see some new files being generated e.g. mm.d, mm.o, mm. This "mm" is probably the executable you're looking for
Now that you know what your executable is, you should tell eclipse what file to execute instead of mm.exe. Go to Project properties and in run debug settings create a new configuration (or edit an existing configuration, if there is one already). In this configuration, in main tab, in C/C++ Application specify a full path to "mm". Which, in your case is - "C:\Users\elisabeth\workspace\mm\Debug\mm"
A better way to do this in eclipse is:
${project_loc}/"your folder"/"your executable file"
e.g.${project_loc}/Debug/mm
what worked for me is file->refresh
then do the Debug configuration again by choosing the right c/c++ binary again.
Avoid troubles with configuration by going into Project properties > C/C++ build > Refresh Policy and specify your project folder. The configuration option "Search project" will show a correct folder then and you will see whatever you build there - Debug, Release or both. You don't want to specify the folder using Browse option every time you import project or switch configurations.
As this is the first SO discussion that appears for this topic on Google and none of the answers solved the problem my students were having, I would like to mention the solution we eventually found from this answer:
Open project properties (Right click on your project, choose Properties on the menu)
C/C++ Build -> Settings
Click on Binary Parsers tab and check PE Windows Parser
Keep clicking Move Up until it is at the top
This had been set to Elf, even though we were using a freshly downloaded Windows version of Eclipse.
sometime missed closing curly brace can be part of a problem. Make sure prototype your function at the beginning of the file. Then right click your project in the left side bar. click clean project. then click build project and finally run project
I encountered similar issues and their related problems a few days ago. Finally, I found out that, just because I had moved my project folder (workspace folder of Eclipse) to another place so Eclipse could not find what its need as usual.
Solution: I just set the workspace to my new place (Hey Eclipse, my workspace now is here) :
Menu "File" -> "Switch workspace" -> "Other..." -> click "Browse..." button and point to new place then click "Select Folder" button and click "Launch" button.
Nice day.

Eclipse indexing not working

I am using CDT in Eclipse 3.5.2 Galileo in Ubuntu.
My eclipse's indexer doesn't work at times. By that I mean when I ctrl click a function it says Could not find symbol in index. Also, F3 button click results in the same error message. Actually most of the places it is not working and works in very few places.
I have seen some other versions of Eclipse where under File menu a menu item listed for Indexing. Like File->Indexer->Rebuild.... But in my File menu there is no such menu item for the Indexer.
Will the only way be to use some other release of Eclipse or am missing something? Any pointers regarding this would be helpful.
In my case nothing has worked and at last I did the following:
1) Close the project
2) Delete the project(do not check from disk option)
3) create new project with existing code(use the deleted project path)
4) Successfully indexed my c++ code
To add paths containing code to parse, follow these steps :
1. Right click on the project
2. Select Properties
3. Go to C/C++ General
4. Go to Path and Symbols
5. If the paths are missing, add paths.
To re-parse the code follow these steps :
1. Right click on the project
2. Select Index
3. Rebuild
If this doesn't work, then you are out of luck. c++ is very difficult language to parse.
If your indexer is stuck and it hangs for infinite time, you can delete the indexer related files of your project from .metadata. Make sure eclipse is not running in the meanwhile.
The .metadata directory is located as a hidden folder in the path of your workspace.
There you can navigate to:
<workspace_path>/.metadata/.plugins/org.eclipse.core.runtime/.settings/
Inside the .settings/ directory there are .prefs files which store the preferences of each project individually.
For example: org.eclipse.cdt.core.prj-test-project.prefs stores the preferences of the project test-project
Open this file with the text editor and remove all the lines starting with indexer. This will reset the indexer settings for this specific project to the default.
Alternatively, you can remove all the lines starting with indexer from org.eclipse.cdt.core.prefs; doing this will reset the indexer settings for the whole workspace.
I believe you can clear the index by running:
rm .metadata/.plugins/org.eclipse.jdt.core/*.index
And then restarting Eclipse. It will then rebuild its index.
This worked for me in a Java project, but I imagine its the same index for all (most?) project types.
Right click on the project.
Select New->Convert to a C++ Project.
Select your configuration. And then Next
Indexer will start indexing all the files.
For me this worked:
Right click and close the project
Open the project again
Right click and select Index->Rebuild
I hope it helps anybody.
You can try rebuilding the index.
Right-click on the project in Project View. Then Index -> Rebuild.
Here is the solution I used after Project->C++ Index->Rebuild failed. This trick avoid deleting your current project :
1) Copy the current project (Right click->Copy from Project Explorer)
2) Paste it (Right click->Paste from Project Explorer) and give the copy another name
3) The indexer should now start and index both projects
4) When indexation is complete, you can delete the copy
PS: Make sure your original project is an actual C++ Project or this will obviously not work.
Convert a project to C or C++ nature:
Right click on project: New >  Convert to C/C++ Project
In "Convert to C or C++": Choose C/C++ Project
In "Project options": Check "Specify Project Type"
...Project Type: Choose "Makefile project"
...Toolchains: Gross GCC
I was having the same problem and it turns out that the index folder was owned by root (I must have run Eclipse as a root once for some reason) I reclaimed the project folder using sudo chown -R username projectfolderpath and problem solved.
Execute eclipse.exe -clean -refresh where the eclipse is installed.
Create a new C/C++ Project in Eclipse with Given Source code folder path. (Not with New Project based on existing workspace)
Above steps worked for me.
For me it was issue that when creating a project indexer was chosen as none. Deleted the project and while creating the project again I chose the indexer options as per my need "LINUX_GCC", then it worked for me
Just came across the same problem in my C++ ARM Cross GCC project. I'm developing on Windows, using Makefile and an Ubuntu Docker image with GNU ARM Embedded Toolchain to build the project.
The solution to get rid of the unresolved symbols, in my case, could be divided into two parts:
The CDT Arm Cross GCC Built-in Compiler Settings didn't have the path to the compiler.
In the Project Properties -> C/C++ General -> Preprocessor Include Paths -> Providers(tab) the path to the compiler must be provided.
Using the GNU ARM Embedded Toolchain, the entry for the Command to get compiler specs: I currently use is:
C:\GNU_Arm_Embedded_Toolchain\9-2020-q2-update\bin\arm-none-eabi-g++.exe ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"
Note: Yes, I am having installed the same toolchain on my Windows machine as I'm using in the Docker image.
To verify, that the call is correct, you can tick the Allocate console in the Console View, which will provide hlepful output to the Console. Also, in the Entries tab, when you unroll the CDT Arm Cross GCC Built-in Compiler Settings you should see the includes and symbols included.
Missing symbol in the Project Properties -> C/C++ General -> Paths and Symbols menu.
As I have my defines in the Makefile, I forgot to add the define of my MCU also here.
Hope this helps to someone! :)
For the most part, the other answers tackle the situation wherein one "had" a working index earlier and things have gone astray for some reason.
On the other hand, I faced a problem wherein I needed to install everything from scratch (eclipse, workspace, c++ project etc.) and the indexing just wouldn't work. I finally found the solution here: https://www.eclipse.org/forums/index.php/t/1109004/
The key inputs from the above page are:
You need to setup include paths for the Indexer just as you would need
to for the compiler. The Indexer and compiler are completely independent.
The Indexer include paths are set by
Project -->Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. --> Entries tab --> CDT UserSettings Entries ...
and
You could try using
Project --> Properties --> C/C++ General --> Paths and Symbols
That's supposed to merge telling the compiler and Indexer
in one place.
However, this latter part of the suggestion did not work for me.

Visual studio 2010 - retain project properties between different build configurations?

I have two projects in my solution. I am currently using the default configuration mode which is 'Debug'. When I want to do a 'Release' build, I switch to Release-mode and then I see all my previous projects properties are set to default, meaning I have to add all properties again manually to this mode.
Is there a convenient way to solve this in VS2010, for example to copy all properties like include paths, preprocessor macros, build macros, etc from 'Debug' to 'Release' mode?
Configuration settings are stored in .vcproj / .vcxproj file. You could open it in some text editor and copy some settings manually, but it wouldn't be convenient. For now you could just open projects properties and copy these settings while switching Debug / Release configuration in the upper left corner of that window.
Next time when you are setting properties that are intended to be the same for all configurations, choose Configuration: All Configurations to avoid troubles.
Property sheets can solve this and a few other property-related issues with ease.
In short, all the properties in a project are just nodes in an XML document, and the property group nodes can have a condition attribute. They're easy to change in any text editor, but a lesser-known feature is the ability to import other XML documents, which can provide settings (for all but a few project-specific ones).
This blog post has a good tutorial on using project sheets, and some more info in this question. You can create them in Visual Studio, edit them (including copying your existing project settings over), then attach them to your project with the property manager (not the property window).
The groups in your property sheet use the same syntax as regular settings, and can be set for all configurations or filtered to only apply on some. They can also be filtered by project name and a few other things, using VS' variable and condition system. For example, I use:
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<Optimization>Disabled</Optimization>
<EnablePREfast>true</EnablePREfast>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
</ItemDefinitionGroup>
for some of my builds, to apply the same settings to all project (full file here).
One of the most convenient uses is giving the build directory in the file, so all your projects build uniformly into the same directory (make sure to use the project name for the output).
Managing almost all the properties across multiple different builds (debug, release, win32, x64 etc.) can be accomplished with a single collection of settings by using Macros.
Thus, before editing a project settings, make sure you've set Configurations to All Configurations and, Platform: to All Platforms. Now almost all settings can be done in this way, across all the different configurations. Say, you want different configurations and platforms to use different versions of various libraries. Assuming you are using a naming convention that's consistent across all projects, you can then use:
Additional Library Directories: ..\..\foo\bar\lib\$(Platform)_$(Configuration)
You can see what macros will expand to, by hitting the edit button, and then clicking on the Macros>> button.
You could also recreate the new mode you want using the configuration manager and then you can choose from which configuration you want to copy all the settings.

Visual Studio 2010: C/C++ global include and lib folder

How to make user include and lib folders globally and permanently available to all projects? In Visual Studio 2008 it is Tools -> Options -> Projects and Solutions -> VC++ Directories. In 2010 it says deprecated... blah blah... instead use property sheets... click '?' for help.... Click and it takes you to a web page about property sheets. Doesn't answer the basis question. How to set user library folders globally, once and for all?
Thank you.
Try this:
VC++ Directories are no longer supported in VS2010 through Tools->Options page. Instead, VS2010 introduces the user settings file (Microsoft.cpp..users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory. Upon migration to VS2010, the custom settings of VC++ Directories from VS2005 or VS2008 are migrated to these user files. These global settings files are imported into all the converted and newly created projects.
Here are the steps to change the settings file through UI:
Open up property manager by clicking on View.Property Manager.
Expand the project node and then the Configuration|Platform nodes, you will see "Microsoft.cpp..users" file for each Configuration|Platform. These are the files for the global settings, similar to the old tools/Options/VC++ Directories.
Multi-Select "Microsoft.cpp..users", right click and bring up the property page window
In the property page window, click on "VC++ Directories" (for example) in the left pane, add new paths for the directories such as "Include Directories". separated by semicolons
Make sure to save the settings before shutting down Visual Studio.
Re-launch Visual Studio and the new settings will be in effect.
Note: If you would like to only change the settings for one project, you can right click on the project and bring up the property page. Change the settings for “VC++ Directories”, these settings will be persisted to the project file.
I found this article helpful.
You can select all the project and edit them all at once.
Open the class view and select all projects.
select configuration properties node and then VC++ directories.
select Included Directories, Libraries Directories and click the
button next to it. Select edit and enter the additional paths you
need, this will be add to all the selected projects.
You can delete any common directories among the selected projects.