Having major problems With Hello World

+1 Eric Persson · December 10, 2015

I thought I was going to learn C++ from learncpp.com, but I meet resistance in the first program I write! 
I'm using Codeblocks, and when making a console application and naming it HelloWorld, the program is automatically written. 
So the first problem is that the Hello World program that Codeblocks wrote didn't work. The only thing that happened was that my cmd promt popped up blank, like on the picture below. I thought it might have something to do with the fact that the code was different. 
Instead of:

#include <iostream>

int main()
 std::cout << "Hello World!";

-as it says on both learncpp.com and cpluplus.com, It said:

#include <iostream>

using namespace std;

int main()
    cout << "Hello world!" << endl;
    return 0;

But when I changed it to the code example given by the sites, I just got the result on the image below with errors this time. 


Post a Reply


Oldest  Newest  Rating
+1 tanner kelsey · December 11, 2015
same happened to me, thanks for the fix 
0 Eric Persson · December 10, 2015
I will try to run it as an admin :) thx for the tip
0 Eric Persson · December 10, 2015
Ok so now I don't get any errors or warnings, but still nothing appears in the cmd. :/
0 Eric Persson · December 10, 2015
HAHAAAAA I solved it :D It was set to debug mode default, it had to be in release mode.

0 Eric Persson · December 10, 2015
Ok now i feel a bit stupid, it should be run in debug mode apparently, but the reason it didn't work was because Avast antivirus blocks stuff. 

Just had to turn off 
- enable deepscreen
- enable hardened mode 
- enable reputation services
0 phapha pha · January 13, 2016
I use codeblock but that doesnt happen to me,

yeah, alway run it as admin,

and try kaspersky man,
it has no problem at all using codeblock
  • 1



Used in many types of software including music players, video games, and many large scale applications.

Bucky Roberts Administrator