Author Topic: no output from cout or printf  (Read 12837 times)

Offline Olives

  • Single posting newcomer
  • *
  • Posts: 2
no output from cout or printf
« on: October 14, 2010, 01:37:41 pm »
Been using Code::Blocks 10.05 for a couple of weeks now and everything thus far was working fine. I created a few console applications and all was good. Now for some reason when I try to use the cout or printf to display text it's doesn't display. I get no compiler errors so i'm a bit at a loss as to what the problem is. I did move some folders around to keep things neat so I decided to start over with the console application template and it still doesn't work.

-main.cpp-
Code
#include <iostream>

using namespace std;

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

-output-
Process returned 0 (0x0)   execution time : 0.000 s
Press any key to continue.

I've also tried running the program outside of Code::Blocks but I get the same result.

Thanks for any help you can offer.
Windows XP SP3; Code::Blocks 10.05; MinGW GCC 4.5.0

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5519
Re: no output from cout or printf
« Reply #1 on: October 14, 2010, 01:46:10 pm »
I don't know what to say. This should really work.

Try to run it from with CB through the debugger ?

Put a break point, just to be sure, your code is actually being carried out ...

Offline Olives

  • Single posting newcomer
  • *
  • Posts: 2
Re: no output from cout or printf
« Reply #2 on: October 15, 2010, 08:55:32 am »
I think I found the problem.

I had the following Global compiler setting, once I removed it everything seem to work again.
Code
-Wl,-subsystem,windows

Thanks for your help :D
Windows XP SP3; Code::Blocks 10.05; MinGW GCC 4.5.0