User forums > Using Code::Blocks

no output from cout or printf

(1/1)

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-

--- Code: ---#include <iostream>

using namespace std;

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

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

--- Code: ----Wl,-subsystem,windows
--- End code ---

Thanks for your help :D

Navigation

[0] Message Index

Go to full version