none of the guides work with visual studio C++

Started by
11 comments, last by Pzc 16 years, 5 months ago
i'm completely lost. i've been reading into a lot of guides on the internet to get into C++ programming, but i can't even get "Hello world" to work because it seems Microsoft VSC++ uses all this extra crap and all the people who created the guides i'm using are using other compilers(like dev-C++). i thought VS was the best type of compiler to use though...so i have no idea what to do. i really want to get into programming but i'm not about to download 4 different compilers just so i can run the simplest program of all.
Advertisement
When you create a project, be sure to select "Empty Project". If you're not doing that now, it will get rid of some "extra crap". Apart from that you should post your code and *exact* error messages.

MSVC compiles standard C++ well, so it should work with any good beginner guide you have.
1) File->New->Project
2) Left pane - Win32, Right pane - Win32 Console Application
3) Enter a name
4) OK
5) Next
6) Application type - Console Application, Additional options - empty project (as Simian man says above)
7) Finish
8) Right click Source Files in the solution explorer and choose Add->New Item
9) Left pane - Code, Right pane - C++ File (.cpp)
10) Enter a name
11) Project->Properties
12) Expand Configuration Properties and select General
13) Right pane - change Character Set to Not Set
14) OK

The following will now compile as expected

#include <iostream>int main(int,const char**){    std::cout << "hello world" << std::endl;}


Don't forget to hit Ctrl+F5 to run though to prevent your console window from closing as soon as the program finishes.

VS probably is the best free compiler available in the world. It is just perhaps not very beginner friendly.

HTH
I'm in the same boat as the original poster. After spending many hours reading up on Visual C++ and c++ in general, I'm still quite miffed at how difficult it is to get a very simple application running.

The amount of wierd stuff that you have to do just to get sample applications started defies logic. One would think that programmers would crave efficiency when working with computers, but surely the the number of proverbial hoops you need to jump through just to get a message box on the screen is unnecessary.

I say this, admittedly as a newbie from a Visual Basic background. I've been spoon fed somewhat, and now I'm trying to learn a 'real' programming language. But if it means the methods are complicated, simply for the sake of being complicated, I think I might just go mad.

I'm sure it'll all click into place soon enough, I am not giving up. But I'm still getting compile errors aplenty which make no sense to me considering I've just lifted the code from supposedly super-easy tutorial sites from the web.

Apologies for the rant.
Quote:Original post by EasilyConfused
1) File->New->Project
2) Left pane - Win32, Right pane - Win32 Console Application
3) Enter a name
4) OK
5) Next
6) Application type - Console Application, Additional options - empty project (as Simian man says above)
7) Finish
8) Right click Source Files in the solution explorer and choose Add->New Item
9) Left pane - Code, Right pane - C++ File (.cpp)
10) Enter a name
11) Project->Properties
12) Expand Configuration Properties and select General
13) Right pane - change Character Set to Not Set
14) OK

The following will now compile as expected

#include <iostream>int main(int,const char**){    std::cout << "hello world" << std::endl;}


Don't forget to hit Ctrl+F5 to run though to prevent your console window from closing as soon as the program finishes.

VS probably is the best free compiler available in the world. It is just perhaps not very beginner friendly.

HTH


i get a problem when trying to go to my project's properties and VS C++ has to restart. what could cause this?

Thanks.

What version of VSC++ do you use ?
2005. and wow, after reinstalling because of the error and trying to download the service pack 1, i get a package error. wtf. i really hate these microsoft products, i can't use any of them correctly without getting errors.

i can't even load a C# project, i get "project creation failed" with C# and Visual basic and i've reinstalled everything.

edit: i can't even open Devcpp

why can't i do anything? should i even consider programming any more? all of this is just so stressful, it's not a good time in my life for, i'm trying really hard to start programming but nothing is working for me. i love games. they're a huge part of my life. i've got no talent. i can't draw, so i can't do what i REALLY love, which is design. so i went to programming because i also love technical marvels such as physics engines, lighting, etc. but i can't do anything with games. i hate this, i really do. i want to do something with games so badly but it seems i can't do either of the interests. i'm also horrible at animations.
That's sort of an odd error. What edition of VS are you using? (Express... Standard... ?)
express, if it even matters anymore.
It would also be interesting to know what windows you are using (version and service packs) and how it's set up. Do you have rights to install the software and use the storage/paths it wants ?

This topic is closed to new replies.

Advertisement