News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

no output from cout or printf

Started by Olives, October 14, 2010, 01:37:41 PM

Previous topic - Next topic

Olives

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-
#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.

killerbot

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 ...

Olives

I think I found the problem.

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

Thanks for your help :D