Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Visual C++ and C++?

Tags:

c++

visual-c++

Well here's a rather stupid question. Is Visual C++ JUST an IDE?? Or is it a language on its own for win32? What exactly would be the difference between the two? This I ask because I was trying out some of my old C++ code on VC++ 2008 and it wouldn't compile.

like image 570
Laz Avatar asked May 18 '10 19:05

Laz


4 Answers

Visual C++ can be many things, including:

  1. Microsoft's C++ compiler (cl.exe, link.exe etc)
  2. The IDE (Visual Studio in C++ mode)
  3. The C runtime (MSVCRT)
  4. Other libraries (less so): MFC, ATL

As for compiling old C++ code: Visual Studio is now a fairly compliant C++ compiler. This was not always the case, such as with Visual C++ 6 or earlier. It is likely your code is not standards compliant or uses deprecated behavior, which simply doesn't work on newer compilers.

Note: this paragraph is outdated: Visual C++ is unfortunately a poor C compiler, as it does not support C99 (and never will), unless features overlap between C++ and C99. The most notable issue for many people is the lack of stdint.h.

Visual C++ supports C11 and C17 starting with Visual Studio 2019 version 16.8 Preview 3

For many years Visual Studio has only supported C to the extent of it being required for C++. Things are about to change now that a conformant token-based preprocessor has been added to the compiler. With the advent of two new compiler switches, /std:c11 and /std:c17, we are officially supporting the latest ISO C language standards.

like image 135
Yann Ramin Avatar answered Oct 09 '22 04:10

Yann Ramin


Visual C++ is an IDE. It compiles standard C++ code. However, every C++ compiler essentially creates its own version of C++. Few compilers are entirely compliant with the current standard, and they may or may not add features from the upcoming standard. In addition, they sometimes add their own extensions to the language. So, there's always a portiability risk when compiling C++ code with different compilers. However, recent versions of Visual C++ are fairly close to standards compliant, and most things which compile with it will compile with other popular compilers like gcc/g++ (and vice versa).

like image 44
Jonathan M Davis Avatar answered Oct 09 '22 04:10

Jonathan M Davis


VS2008 includes both standard C++ and Microsoft's Managed C++. The standard C++ is mostly compliant with C++03 (at least that was the intent). Managed (i.e non standard) C++ is for developing .NET applications and is not (nor was it intended to be) compliant with any C++ standard.

You might want to make sure that you didn't accidentally select Managed C++ when you ported your app.

like image 3
andand Avatar answered Oct 09 '22 05:10

andand


Visual C++ is the name of Microsoft's IDE and compiler for the C++ programming language. Note, though, that -- like many C++ implementations -- Visual C++ has certain extensions that are not provided by C++ as well as certain areas where it fails to fully conform to the ISO C++ language standard.

like image 1
Michael Aaron Safyan Avatar answered Oct 09 '22 05:10

Michael Aaron Safyan