Questions tagged [visual-c++]

Microsoft Visual C++ is a C, C++ and C++/CLI compiler for Windows. The most recent version of the compiler is Visual C++ 2019. The compiler supports the following languages: C (supports C90 and most of C99 and C11 parts of the ISO C++ standard as of Visual Studio 2019); C++ (support for most C++11, C++14 and C++17 features and some C++20 features as of Visual Studio 2019) C++/CLI (Provide interoperability with .NET languages like C#).

Microsoft Visual C++ is a C, C++ and C++/CLI compiler for Windows. The most recent version of the compiler is Visual C++ 2019.

The compiler supports the following languages:

  • C: Supports C90 and most of C99 and C11 parts of the ISO C++ standard as of Visual Studio 2019
  • C++: Also includes support for most C++11, C++14 and C++17 features, and some of C++20 as of Visual Studio 2019
  • C++/CLI, providing .NET integration in C++
  • C++/CX for interfacing with WinRT

Visual C++ also supports debugging a native code, mixed (native+managed) code, as well as raw assembly code. Rich debugging features include debugging from start, attaching to a local or a remote process. It also allows multiple processes to be debugged at once. Breakpoints, conditional breakpoints, data breakpoints are of great help.

Resources

29606 questions
525
votes
4 answers

What is "stdafx.h" used for in Visual Studio?

A file named stdafx.h is automatically generated when I start a project in Visual Studio 2010. I need to make a cross-platform C++ library, so I don't/can't use this header file. What is stdafx.h used for? Is it OK that I just remove this header…
prosseek
  • 155,475
  • 189
  • 518
  • 818
467
votes
31 answers

Why is this program erroneously rejected by three C++ compilers?

I am having some difficulty compiling a C++ program that I've written. This program is very simple and, to the best of my knowledge, conforms to all the rules set forth in the C++ Standard. I've read over the entirety of ISO/IEC 14882:2003 twice to…
James McNellis
  • 327,682
  • 71
  • 882
  • 954
300
votes
33 answers

Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)

I've installed Python 3.5 and while running pip install mysql-python it gives me the following error error: Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat) I have added the following lines to my Path C:\Program Files\Python…
Umanda
  • 4,159
  • 3
  • 20
  • 27
226
votes
3 answers

In Visual Studio C++, what are the memory allocation representations?

In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time. From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and…
HidekiAI
  • 2,783
  • 3
  • 17
  • 22
224
votes
5 answers

Visual Studio 2010 - C++ project - remove *.sdf file

I would like to know if I can safely delete the sdf file that stores information for Visual Studios Intellisense - is it going to be rebuilt the next time that I open the solution? Do I lose anything by doing so? Is it possible to break the solution…
kubal5003
  • 7,038
  • 7
  • 47
  • 85
201
votes
29 answers

fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

I'm using CUDA (VC++, Visual studio 2008sp1) to debug a FEM program. The program can only run on a Win32 platform, for the insufficiency of cuda. I think the library files linked are all compiled on the x86 platform, but when I compile it, I get the…
user430382
  • 2,011
  • 2
  • 13
  • 3
199
votes
28 answers

Unresolved external symbol in object files

During coding in Visual Studio I got an unresolved external symbol error and I've got no idea what to do. I don't know what's wrong. Could you please decipher me? Where should I be looking for what kind of errors? 1>Form.obj : error LNK2019:…
Novellizator
  • 9,169
  • 9
  • 38
  • 58
199
votes
22 answers

How to keep the console window open in Visual C++?

I'm starting out in Visual C++ and I'd like to know how to keep the console window. For instance this would be a typical "hello world" application: int _tmain(int argc, _TCHAR* argv[]) { cout << "Hello World"; return 0; } What's the line…
Raúl Roa
  • 10,841
  • 13
  • 45
  • 62
183
votes
3 answers

What does #defining WIN32_LEAN_AND_MEAN exclude exactly?

I found the explanation defining WIN32_LEAN_AND_MEAN "reduces the size of the Win32 header files by excluding some of the less frequently used APIs". Somewhere else I read that it speeds up the build process. So what does WIN32_LEAN_AND_MEAN…
fishfood
  • 3,442
  • 4
  • 24
  • 32
179
votes
5 answers

Automatically add all files in a folder to a target using CMake?

I am considering switching a cross platform project from separate build management systems in Visual C++, XCode and makefiles to CMake. One essential feature I need is to add automatically all files in a directory to a target. While this is easy to…
martjno
  • 3,912
  • 5
  • 29
  • 31
175
votes
7 answers

Link to all Visual Studio $ variables

I was having a look at $(Configuration),$(ProjectDir) etc. in Visual Studio 2008 for Prebuild events. Is there a link to all of these variables with a definition for each one of them?
chugh97
  • 8,936
  • 24
  • 81
  • 132
175
votes
8 answers

Which Visual C++ file types should be committed to version control?

Which Visual Studio \ Visual C++ file types should be committed to version control? In my project I have the following file…
Jonathan
  • 84,911
  • 94
  • 244
  • 345
175
votes
5 answers

What does "#pragma comment" mean?

What does #pragma comment mean in the following? #pragma comment(lib, "kernel32") #pragma comment(lib, "user32")
user198729
  • 55,886
  • 102
  • 239
  • 342
152
votes
32 answers

How to determine if a string is a number with C++?

I've had quite a bit of trouble trying to write a function that checks if a string is a number. For a game I am writing I just need to check if a line from the file I am reading is a number or not (I will know if it is a parameter this way). I…
Brendan Weinstein
  • 6,382
  • 6
  • 22
  • 29
150
votes
13 answers

error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

While I am running the simple code as below I have two errors as following: #include #include using namespace::std; template class Stack { public: Stack (int max):stack(new Type[max]), top(-1), maxsize(max){} …
NAIEM
  • 1,529
  • 3
  • 11
  • 6
1
2 3
99 100