Visual Studio and native Hello World

Hey,

I used to code in code blocks but because I could not find way to use "urlmon.h" header I changed to Visual Studio (kinda question if it's possible to use that in c::b).

But ya..installed VS2010 and after trying to make simpliest hello world I get errors.

What I do is:

1. Create new Project --> WIN32 --> Win32 Console Application
2. I have checked and unchecked precompiled headers (same result in the end)
3. Then I get my project and I write code

1
2
3
4
5
6
7
8
#include<iostream>
using namespace std;

int main()
{
cout<<"Hey YA!"<<endl;
return 0;
}


4. After that I press 'F5' or 'start debugging' -button and I get these errors:

*************

------ Build started: Project: asddd, Configuration: Debug Win32 ------
Build started 3.7.2012 17:03:25.
InitializeBuildStatus:
Touching "Debug\asddd.unsuccessfulbuild".
ManifestResourceCompile:
All outputs are up-to-date.
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
c:\users\Bill Gates\documents\visual studio 2010\Projects\asddd\Debug\asddd.exe : fatal error LNK1120: 1 unresolved externals

Build FAILED.

Time Elapsed 00:00:01.66
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

***********

And I want to code only native CPP so is it possible in visual studio? And is Visual C++ just name for IDE...?

you can use standard c++ in visual c++.. i think visual c++ has minor differences with normal c++...

To use standard c++ create an empty project and add files on you own... do not select the w32 console application...
Last edited on
What I do is create a win32 console application, then on the last screen of the wizard check "empty project". Then, manually create a .cpp file under the source files section
hmm... i did exaclty like you said and it work fine overhere...

how did you add the file? you need to right click on source files and then select add (new or existing...)
Thanks guys, now it works.

Previously when I created empty project I just added a new .cpp (ctrl+n) -file but now added new item to project (ctrl+shift+a).
Topic archived. No new replies allowed.