Visual Studio Code uses C++98. Change it to newer version? - c++

I just downloaded Visual studio Code and like it so far. I mainly use C++, but I prefer the newer versions.
I just wanted to write a little test program and noticed, that my VS Code uses C++ 98.
Is there a way in which I can tell my compiler or VS Code to use a higher version of c++?

Related

Deploy a c++ game to other windows machines

I have created a c++ game with the following libraries : SDL2 and SDL2_MIXER. I want to give the game to some friends who have no programming experience to play with. Now I don't really know how to do that.
What I have tried is to use installshield limited edition with visual studio. After giving the installation program to some friends they all had a common problem-error that a dll MVCsomething was missing.
What is the simplest way to give my friends the app? Since c++ is translated to assembly do I have to compile the source again each time I change a machine?
Given the way that you've tagged your question, it is unclear if you are using Visual Studio or CodeBlocks to compile the code.
I guessing that you're compiling it in Visual Studio, and therefore they're getting an error that they don't have the appropriate MSVCRT DLLs—in other words, the C runtime library that your code depends upon, having been compiled with Microsoft's compiler. Point them to download the version of the Visual C++ Redistributable matching the version of Visual Studio that you're using on your development computer. For example, if you have VS 2015, they'll need to install Visual C++ Redistributable for Visual Studio 2015.
Alternatively, you can bundle the required redistributable into your installer to make sure that it gets installed automatically, if it isn't already. In InstallShield, I believe that's done by marking the VC++ Redistributable as a "requirement". Make sure that it's set as a prerequisite. Although, judging from the answer to this question, it may be that InstallShield LE doesn't support this. If that's the case, my advice would be to ditch InstallShield altogether and use something like Inno Setup to build an installer. There is a moderate learning curve, but it is useful knowledge. That being said, I can't believe Microsoft would ship a mechanism for creating a setup program with Visual Studio that didn't support automated installation of the CRT. I have not kept up with what Visual Studio supports nowadays with respect to setup wizards.
Since c++ is translated to assembly do I have to compile the source again each time I change a machine?
No, no. Assuming that your friends are all running Windows (and not, say, Linux) and have x86-based machines (which they do if they're running Windows), your code will work fine. The only hitch would be if you are compiling 64-bit code that runs on your machine, but they only have 32-bit machines. Then you'll need to have a 32-bit and 64-bit version. (Or a single 32-bit version, which will run on both.)

Using different compiler in Visual Studio

This maybe a beginner question but could not find proper answer on the internet.
I am curious can I use some other compiler (which I like) in Visual Studio 10?
As of Visual Studio 2010, it is conceptually possible to integrate another compiler. In the book ‘Inside the Microsoft Build Engine, Using MSBuild and Team Foundation Buid’ 2nd edition, on page 338, the chapter ‘Adding a New Platform and Platform Toolset’ the process of adding gcc to visual studio is explained.
However, while it is possible, it has always remained as a concept. To my awareness, nobody has actually been up to the task and publicly disclosed the results. But even with this support, you'd still be lacking debugging facilities. Which would require your compiler of choice to generate .pdb files and/or extend visual studio with a new local debugger
In summary it's quite a venture
You can use other compiler Intel c++ in VS. I don't think any other compiler supports VS.The main reason behind it is lack of plug-ins in VS. But you can use cmake scripts to compile your code in different compilers. With eclipse you can use most of the compilers (VS,gcc). Code blocks also allows you to choose the compilers.
Yes,you can use Intel C++,and even MATLAB 7.1 or later for sure..here is a reference to use MATLABIt gives a step by step procedure to use MATLAB with VS
You can also write Java programs and include javac compiler for it...you can refer this if needed..Including javac with VS
I kno this is surely possible from VS 2010 but not sure for the b4 editions..hope it helps..

Compiler used by Visual Studio for C++?

I have tried searching on the internet but could not find out the compiler used by Visual Studio for C++ applications.
I wanted to know whether it is freely available & whether it can be used for commercial applications.
Traditionally I have been using Turbo C++.
The problem with Visual Studio C++ Express is that it does not work with some applications.
For example, BRL-CAD which is an open source project works properly with the commercial version but gives some problems for the Express edition.
It seems that there is some problem with MinGW compiler as well.
I am told this by the people running that project.
Visual Studio uses the same compiler for all editions. So, the Express edition uses the same compiler as the Professional edition. There are also no restrictions on producing commercial applications, in either case. There are differences in the advanced features offered by the IDE, but the compilers are the same. So whatever your problems are in getting the project to work, it is nothing to do with the compiler.

Which version of C++ am I using?

Currently I am using C++ in Windows environment. I am using Visual Studio 2008 with Service pack 1.
I never thought about C++ version unless until I came to know about C++11. There appear to be different versions like ANSI standard, C++ 98 Standard etc.
How do I get to know which version of C++ am I using?
If I don't have Visual Studio I know I can use other Compilers like TC to compile my C++ code. In that case how can I get to know which version of C++ the compiler is using.
Are the changes made in consecutive C++ versions about Programming concepts or only in Language design?
It's not as simple as a version check.
Every compiler that supports some C++11 supports a different subset of C++11. No compiler advertises full compliance with C++11 yet, for obvious reasons.
The C++11 specification requires that a predefined macro, __cplusplus be defined which has the value 201103L. However, you cannot rely on this macro alone. Not in real code.
You instead have to rely on compiler-specific macros to tell when compiler and which version of that compiler you're using. Or you can use Boost.Config to help you detect whether specific features are supported.
Visual Studio 2008? You can forget C++11.
Visual Studio 2010 has some C++11 but it's buggy.
Visual Studio 2012 has better C++11 for some features, but others are missing.
Visual Studio 2013 has new support for variadic templates and other features.
But VS is behind other compilers such as gcc in C++11 support.
You can download free express editions for all these versions.

How do I install the minimal facilities of Visual Studio 2008 sufficient for building C++ applications using Visual Studio 2010's multitargeting?

Dev10 has facilities for using the C++ compiler shipped in Orcas. However, I really don't need to install the full IDE -- I merely need to use Orcas' compiler because I need to support Windows 2000.
What's the simplest way of installing just the bits required to build using Orcas' toolset in Dev10?
Given your condition, I'd say just install VS2008 and use it. While it's not what you want it's the fastest path to working.
What about setting up Visual studio 2008 to work with Orcas compiler ?
I'm sorry I don't know about this very compiler, but I know it's possible to use VS2008 with a different compiler, because I tried it.
You can find plenty of doc on running VS2008 with, for example, the Windows SDK compiler or VS2010 compiler. For example that links explains that quite well : http://www.codeproject.com/Tips/105011/Using-Visual-Studio-2008-IDE-with-Visual-Cplusplus.aspx
HTH