Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compiling "standard" C++ in visual studio (non .net)

(This is a probably a very beginner question and I may be missing something obvious)

I've just moved from my mac back to windows, and I'm trying to get set up with C++. I have visual studio 2008 C++: how do I compile "normal" non .net/clr C++? I want a command line application, and the only project that seemed fit was "CLR console application." My stuff works and compiles fine with Xcode or dev C++, but VS gives me 57 errors, and seems to only want me to do .net stuff. I have to include "stdafx.h" before it will even do anything. Can I just use plain old C++, with std::string and vectors, without the .net stuff? Or do I need dev c++?

thanks guys!

like image 583
Gordon Gustafson Avatar asked Jul 28 '09 17:07

Gordon Gustafson


2 Answers

Create a Win32 Console Application.

The Win32 part might be a bit confusing, but what it means is basically just a native C++ project (from which you can use the Win32 should you so desire - but you don't have to)

stdafx.h is the default precompiled header (which you probably don't want. I have no idea why they enable that as default, since it is completely pointless in small projects). In the project creation wizard, be sure to select "empty project", or it'll create the precompiled header plus a couple of other files you don't want or need. It can also be turned off in the project properties.

like image 168
jalf Avatar answered Oct 22 '22 16:10

jalf


Select General->Empty project project type.

like image 29
Dmitry Risenberg Avatar answered Oct 22 '22 15:10

Dmitry Risenberg