Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

object01

Need debugging console (NOT Quake-style)

This topic is 6141 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m learning DirectX, and would like to have a console window to print debugging information to. After a lot of searching I found out about AllocConsole(), but cout and printf don''t affect it. No doubt I''m missing something. Bearing in mind that I''d rather not reformuate all my projects as console applications, how can I open and use a console window like this? -- Jeff S.

Share this post


Link to post
Share on other sites
Advertisement
Well, if STDOUT is redirected to the console anyway by AllocConsole(), why don''t cout and printf work for it? They write to STDOUT unless otherwise instructed, right?

--
Jeff S.

Share this post


Link to post
Share on other sites
if you want just something like an MS-DOS window, then just change the linker settings to have one. If you''re using MSVC++:

Project->Settings->Link

At the bottom text box, type:
/entry:WinMainCRTStartup
/subsystem:console

then you have an MS-DOS window that uses cout and printf. To change back to regular windows, replace console with windows

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by object01
Well, if STDOUT is redirected to the console anyway by AllocConsole(), why don''t cout and printf work for it?

AllocCOnsole does not redirect STDOUT, etc. Use freopen() as Dean posted above.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!