How to integrate VSCode with the Visual C++ compiler? - visual-studio

How to integrate Visual Studio Code with the Visual C++ compiler to build and debug C++ MFC solutions?

You would need to try and use on e of the msbuild VSCode extensions: they can help mainly for Visual Studio setting files completion.
The official Microsoft vscode cpp extension does allow to call Visual Studio msbuild, but only through a Build task, as mentioned in issue 984.
An answer such as "VS is much better than VSCode, so don't bother" would be a (possibly) good answer.
I doubt indeed you will find all the Visual Studio features directly in VSCode.

Related

Visual Studio 2010 express compiler

I would like to know if I can somehow compile c++ code in visual studio express 2010 with a 2019/2022 compiler. I only want to use express 2010 as an editor. I get no results on google regarding this topic.
Edit: I can change from platform toolset V100 to V90 but I'd like V143 like VS 2022. Is it possible though?
It is possible, but why on earth would you want to continue using Visual Studio Express 2010 as your IDE? VS2022 is so full of goodies and the community edition is free to use.
That being said: The VS2019/VS2022 compilers are just cl.exe, link.exe etc... You can use these compilers instead of the VS2010 cl.exe, link.exe etc... The VS2010 integrated build system will not automatically find them, so you'll either have to fiddle around with paths, get in to trouble with compiler switches etc...
You could switch to makefiles (or CMake) to use the compilers and keep the IDE. VS2010 is then no more than a fancy editor.
Tip: Try compiling your code from the command line (cmd.exe) to get started. Or download VS2022 community edition.

How to use newest MSVC compiler (2017) in old Visual Studio (2010)?

I have a weak computer and the interface of modern Visual Studios (2015/2017) works extremely slowly on it. I'm satisfied with the speed and functionality of the interface of Visual Studio 2010, but I want to use the latest features of C++.
How can I connect the compiler and debugger of VS2017 toolset to the VS2010 IDE?
I'm not sure you can do that. You can try changing the toolset directories. But I highly doubt that will work.
But I can suggest other approaches:
- switch off intellisence and other features of VS
- uninstall VS packages you do not need
- Try Visual Studio Code instead. If you are not tied to Windows, get a Linux OS and use it with Visual Studio Code.
- Otherwise use another editor to code in (like notepad++) and use only the command line to build projects (you cant use the debugger in that case)

Generate visual studio solution on mac with cmake

Using the CMake GUI, for the same CMakeList, I am able to generate VS solution files on Windows and XCode solution files on Mac. However I am unable to generate VS solution on Mac, as I don't use any VS options under Specify the generator for this project.
I have VS 2017 Community for Mac installed on the Macbook. Is there anything I am missing?
Visual Studio for Mac is very different from Visual Studio.
The former is based on Xamarin Studio, a product of Xamarin Inc., which was acquired by Microsoft in early 2016. Microsoft then basically rebranded Xamarin Studio as Visual Studio for Mac. Note that Xamarin Studio was mainly an IDE for developing mobile apps. Visual Studio for Mac currently has no support for C++.
Because of this, CMake currently does not support Visual Studio for Mac. The Visual Studio generators that ship with CMake only work with the Windows versions of Visual Studio.
And before someone asks: They also don't work with Visual Studio Code, which is yet another product that has little in common with Visual Studio except the name. Unlike Visual Studio for Mac however, Visual Studio Code has extensive support for C++ development with CMake through plugins and might be a viable alternative if you're looking for a Visual Studio-like development experience for C++ on Mac.
In that case, you open the workspace directly with VS Code and let its CMake plugins handle the configuration of CMake. You will not use the Visual Studio generators of CMake for VS Code, as VS Code is unable to work with the generated solution files.

What is the difference between visual studio and visual c++ IDE

What is the difference between visual c++ and visual studio.
Also codes written in visual c++ do affect the portability and functionality of the code??
Visual C++ is one of the languages that is supported in the Visual Studio IDE. I'm not aware of a separate Visual C++ IDE, and relevant searches return information about working in Visual Studio.
These are all part of Microsoft's development platform, and as such they most easily target Windows platforms and .NET. Beyond that I'm not sure I understand your question about portability.
I remember seeing Visual C++ awhile back but Microsoft has moved to making Visual Studio their single IDE.
Check out this wiki link for more information. It says that Visual C++ has migrated into Visual Studio. However, it seems there might be some compatibility issues if you are using an older VS. I see you tagged VS2010 so you may want to read up on it depending on what functions you're using. Looks like VS2015 update 3 is the latest release that captures those functions.
https://en.wikipedia.org/wiki/Visual_C%2B%2B

Can I compile visual studio solutions (.sln) without installing visual studio

Can I compile visual studio solutions (.sln) without installing visual studio. Can I install something like a VS SDK to do this?
The solution is a VC++ one.
I think the SDK still comes with MSBuild and a barebones compiler. You might also want to look at "VS Express", depending on your reasons not to install Visual Studio.
You can try call the MSBuild.exe which become wiht the .NET Framework 3.5 and probability with old versions too.
I actually use this for my NAnt builds.
use something like:
"dotnet.dir" /msbuild.exe ./solutionX.sln" /v:q /nologo /p:Configuration=Release
You should be able to use vcbuild.exe to do it. I believe it is included with the Windows SDK.
Certain C++ libraries such as MFC and ATL only ship as part of visual studio so you will need visual studio on the machine to build if you make use of any of these.
Luís Custódio is right.
Visual Studio is launching msbuild under the hoods...
Tip
Change the setting for the verbosity of the build output to see some details in
Tools | Options | Projects and Solutions | Build and Run
You can separately install the MsBuild tools

Resources