Visual Studio 2019 generates an error when I try to build a project that I downloaded from github. The author of the github repository says that upgrading my c++ compiler version might solve this problem.
In the About tab in Visual Studio it says "Visual C++ 2019 00435-60000-00000-AA811". Is this the compiler version? And how do you upgrade the compiler?
"Desktop development with C++" was downloaded with "Get Tools and Features" a few days ago.
Please see the picture below for more detailed information about the error.
Go to extensions, then type ms-vscode.cpptools in the search bar.
Click on the C/C++ extension, and to the right of Uninstall, there should be a gear icon. Click it.
A dropdown menu should open. Select Extension Settings.
Now click in the search bar (sometimes it makes you click twice before you can type without replacing the extension filter) and type cppStandard.
From here, you should see two options, one for Cpp Standard, and one for C Standard.
Change Cpp Standard to your desired version.
Related
I'm creating a DLL using C++ in Visual Studio 2015. I started my project by following these instructions.
I need to add a reference to my project so I can make use of an API and, unlike C# DLL projects (for example), I'm unable to access the Browse tab when clicking on Project > Add Reference.
According to this page this is because:
The number of tabs available at the top of the Add Reference dialog
box can vary, depending on the type of project open and the resources
it is using. C++ native projects contain only a Projects tab.
Why is there this restriction and is there any way to get around it?
EDIT: I've just found a solution here but I'm new to Visual Studio and I'm not sure how to set 'the CLR option' and then remove after adding my reference. If anyone can explain how to do this I would be very grateful!
I'm a little late to the party, but I recently encountered a similar problem and have a fix that might help the OP or others in the future.
Problem Overview:
Open the Visual C++ project[1] in Visual Studio[2]. In the top toolbar, click on "Project > Add Reference..." . In the window that pops up, there is no "Browse" button/option (see image No Browse option).
Solution:
In the top toolbar, click on "Project > Properties"[3]. In the left navigation panel of the window that pops up, click on "Configuration Properties > General" (this will probably be selected by default). In the right panel, click on "Project Defaults > Common Language Runtime Support". The field value should read "No Common Language Runtime Support" (see image No /clr). Using the drop-down menu in the Common Language Runtime Support field (the grey down-arrow box), select "Command Language Runtime Support (/clr)". Apply the change. The Property Page should now look like this. Click "OK" to close the Property Page. Now, when you go to add a reference, the window that shows up will have a "Browse..." button and look like this. If you want to subsequently remove CLR support[4], select the "No Common Language Runtime Support" option and apply the changes.
Notes:
[1] As you're probably aware, you can select from various project types when creating a new project in VS. I experimented with most of the Visual C++ project types included under the Visual C++ template. Since the problem -- lack of "Browse" option when adding references -- seems to be related to CLR support, you will encounter this problem in all Visual C++ project types that are not created as Visual C++ CLR projects. Thus, if you want avoid the problem from the get-go, consider creating a CLR project from the start.
[2] I was able to replicate the problem in Visual Studio 2015, 2017, and 2019; the same solution works for all versions.
[3] Before changing any Configuration Properties, use the Configuration drop-down list in the top-left of the Property Page to select which configuration you would like to change the properties for, e.g. Debug, Release, All.
[4] If you have added references after turning on CLR support, then turning off CLR support is dubious as suggested by #Cody Gray in the comments to the original question. I have not tried to build a project after doing something like this so I can't speak to the solution suggested here. My answer is just to tell you how to change the CLR support.
For C++ projects, you need to get all the projects into the same solution and then when you go to Add Reference you'll see the other projects listed. You then just check the box to 'add the reference'. Keep in mind that this will cause the import library of the DLL (or a static library for a non-DLL library project) to link against your target project. It will not add any include paths you might need to get to the import headers for your DLL.
DirectX Tool Kit has instructions for adding project-to-project references for a C++ project that you might find useful to read over. See here.
For some general background on C++ project-to-project references. See this Visual C++ Team blog post which was published when they were updated for Visual C++ 2010.
Although I have enabled masm checked box in my project properties under build dependencies tab but the Microsoft Macro assemble tab does not show up in my project properties. Is that a bug in my vs2013 or something else?
Look at the answers to the following question for some things to try: How to enable Assembly Language support in Visual Studio 2013
I had the same problem, but I was able to get Microsoft Macro Assembler to appear in the project configuration panel by following one of the suggestions listed at the above page. Specifically, I right-clicked an .asm file in the project and set the Item Type to Microsoft Macro Assembler. When I re-opened the project configuration, Microsoft Macro Assembler magically appeared in the list.
Not a bug neither an issue in the visual Studio.All that you are making mistake is not making tick on the empty project while making a new win32 project.That popup menu comes when you make a new project and you have to tick the empty project checkbox then it will be available as you asked.
I am new to VS.
Went to Extensions and installed JSLint.NET, it is also enabled.
But I get no item under Tools to configure or use it?
JSLint.NET is configured on per project basis. Right click on your project and you should see a menu choice for JSLint.NET Project Settings.
You can see an example of this on the Visual Studio gallery page for the extension.
JSLint.NET Extension
In Visual Studio version 2002 and 2003 "Go To Definition" would find the selected type or member in the Object Browser. In 2005 onwards it opens a source window "generated from metadata" instead. How do I configure these newer versions to go to Object Browser? (In other words, I have the opposite problem to this one.)
Installing ReSharper makes this change, so I know it must be possible, but how do I do it without ReSharper?
As workaround you can create the following macro:
Sub GoToDefinitionUsingObjectBrowser()
DTE.ExecuteCommand("Edit.SelectCurrentWord")
DTE.ExecuteCommand("View.ObjectBrowser")
DTE.ExecuteCommand("View.ObjectBrowserSearch", DTE.ActiveDocument.Selection.Text)
End Sub
Then go to Tools/Options/Keyboard and assign hot key for this macro.
Tested in Visual Studio 2010.
I believe what re-sharper is doing is doing some hooks on that click event with the Visual Studio SDK I do not think there is any simple menu or location that can change that setting.
Instructions (pulled from CODE Magazine) edited down a bit to the part that pertainst to making the right click menus.
Creating a VSPackage
...The VS SDK installs a few more project
templates in Visual Studio, one of
them being the Visual Studio
Integration Package (Figure 1),
located under Other Project Types >
Extensibility on the New Project
dialog box.
After this standard dialog box, the
Visual Studio Integration Package
Wizard guides you through creating the
new package project:
Select a programming language. The wizard currently supports Visual
C++ and Visual C#. You can create or
pick a key file to sign the new
package.
Supply basic VSPackage information. The wizard prompts you
for details such as the company name,
VSPackage name, version, icon,
detailed information, and minimum
Visual Studio edition (such as
Professional or Enterprise) that the
package is designed to at this step.
This information goes into the Visual
Studio splash screen and About dialog
box and is also used to request a PLK
for the package (covered later).
Select VSPackage options. A package may add three types of
functionality: Menu Command, Tool
Window, and Custom Editor.
A menu command is a command added either to the menu
at the top of Visual Studio or
to a context menu (right-click).
When the wizard finishes its job, the
VS SDK adds core elements to the
solution to support the new package.
For instance, if you selected Tool
Window as part of the functionality
for the package, the project contains
a user control where you should place
the visual controls for the window.
The project also contains files for
.NET code to handle the functionality
that you will add to the package.
A CtcComponents folder contains
pseudo-C++ files (ctc files) where you
define things like menu, groups,
buttons, etc. Fortunately, Microsoft
is phasing out CTC files and replacing
them with a friendlier, XML-based VSCT
file format (which will ship in the
SDK for Visual Studio 2008).
The wizard creates a few other files
with .NET code required for the
plumbing of the package within Visual
Studio. Some of these files contain
classes that map the C++ constants to
.NET constants and other files contain
configuration information for the
package when it’s installed.
I know it has been a long time, but it appears, at least in newer versions of Visual Studio for the VB (Basic) language, to be an setting in the options.
Text Editor > Basic > Advanced
Under "Go to Definition".
I don't know why they don't have that for other languages...
Place the mouse cursor on the object you want to access on the object browser. Then, use the keyboard shortcut ctrl + alt + j, which will take you directly to the Object Browser window.
Has anyone tried to build or seen a plugin for visual studio that replaces the object browser of with Reflector? It would be really cool if I do "Go to Definition" I would end up in Reflector at the correct place instead of in the VS object browser.
The TestDriven.net Visual Studio addin (also from here) adds a menu item to go to Reflector from within Visual Studio. I don't think it replaces "Go to Definition" though, so you would have to click the correct (ie. Reflector) menu item.
A Reflector Pro (paid for version of Reflector) is coming soon, which gets installed into Visual Studio, so it may have the ability to decompile source code using Reflector instead of using the object browser. If not, ask for it as a new feature on their forum :)
EDIT: as if almost on cue, the beta of Reflector Pro was announced today and it does have an "Open in Reflector" command.