Printing text

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pippy
Posts: 49
Joined: Sun Jul 08, 2007 11:31 pm

Printing text

Post by pippy »

As a C coder (going on C++ coder), I print debug text or information using fprintf(stderr,"") or fprintf(stdout,"")

This isn't desirable when building a release version of a game, as it would require a console box to be open. How would I pipe text and debug information to console and have it not show up in a release version?
Atraides
Posts: 18
Joined: Wed Jun 06, 2007 1:09 am
Location: Australia

Post by Atraides »

i just did a quick search of the forums and found this.

Code: Select all

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
this will supposably hide the console window. you just need to put it just before your main()

*note i havent tested it, its just what i have seen*
Cheers
Courtney
pippy
Posts: 49
Joined: Sun Jul 08, 2007 11:31 pm

Post by pippy »

Atraides wrote:i just did a quick search of the forums and found this.

Code: Select all

#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
this will supposably hide the console window. you just need to put it just before your main()

*note i havent tested it, its just what i have seen*
thanks! to be honest i thought i would have to rewrite my code to stream text to the irr stream

but that seems a lot easier. However i notice the "/SUBSYSTEM:windows", does this mean its not cross compatible?
catron
Posts: 158
Joined: Mon Feb 19, 2007 1:54 am

Post by catron »

what compiler are you using?

in code::blocks goto Project->Properties->Targets->Type = GUI Application.
also you may have to retype the output and execution dirs. it is a cross platform solution so good luck
Post Reply