![]() |
|
How to print out to console in Visual Studio Express? |
Ravenclaw
Member #9,022
September 2007
|
I tried using cout << "Hello"; but this does not print anything. |
DanielH
Member #934
January 2001
![]() |
Could be that you didn't RTFM! It is probably due to the fact that you are compiling a windows app and not a console app. Maybe? I'ts like saying 'I tried building a WOODEN box with PLASTIC parts!' |
Ravenclaw
Member #9,022
September 2007
|
I didn't pose the question correctly, sorry about that. I don't want to create a console app, but I want to create a normal allegro app and print out to the output window of Visual Studio (not the windows console). Is that possible? |
Hard Rock
Member #1,547
September 2001
![]() |
Try ATLTRACE(), it works like printf. _________________________________________________ |
axilmar
Member #1,204
April 2001
|
Look up the definition of OutputDebugString function in MSDN. I always wondered why Microsoft IDEs don't capture stdout and stderr like all other environments. But what am I saying...you can't expect otherwise from the company that introduced WinMain. |
Ravenclaw
Member #9,022
September 2007
|
Thanks! I also found an alternative: freopen("file.txt", "w", stdout); This will redirect all standard output to the file "file.txt". So every time you make a cout call, the output goes to the file. Each subsequent call appends to the file. |
HoHo
Member #4,534
April 2004
![]() |
... and if you install some unix tools on your windows you can watch the file change in realtime with #tail -f __________ |
count
Member #5,401
January 2005
|
Quote: some unix tools What tools would that be? Sounds interesting.
|
HoHo
Member #4,534
April 2004
![]() |
I think it was msys from mingw homepage. Either that or something that came with KDE4-windows alpha packages. __________ |
count
Member #5,401
January 2005
|
Thanks. Will check this out.
|
|