Not console application. Is possilbe?

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.
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Not console application. Is possilbe?

Post by pelonzudo »

Hello every one. I'm new in that of irrlicht and I'm doing some tuturials. I'm using CodeBlocks and VC++ compiler. All is going "fine" (for now) but I have a question. Is it possible maque the "game" a non console application?

When I compile the project, one of the settings is "console application" and when I run it display a console that opens a window. So I want to star the application without the "console window" so I don't have the two windows (console and "game")

Is that possible? Or could I hide the console? When I change to proyect form console application to window application I get a Linker error.

Thanks in advance.

PD: Sorry if I don't write so well, I'm spanish.
dgrafix
Posts: 116
Joined: Sun Nov 18, 2007 2:36 pm

Post by dgrafix »

Its possible. Under compiler settings targets (in codeblocks anyway) you can choose console or window app.
I find the console very useful when debugging though, but wont be needed for release version.
C++/Irrlicht Noob pl3se B p4t1ent.
Visit www.d-grafix.com :)
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Yes you can do it the way that dgrafix explained, or you can just do(on Windows):

Code: Select all

#include <windows.h>

...

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
instead of

Code: Select all

int main()
int main(int argc, char **argv)
int main(int argc char *argv[])
etc.
TheQuestion = 2B || !2B
Saturn
Posts: 418
Joined: Mon Sep 25, 2006 5:58 pm

Post by Saturn »

Halifax wrote:or you can just do(on Windows):
...
It is not or, it is and. ;)
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

This is how I do it in my engine.

Code: Select all

//! Define _NGE_DISABLE_CONSOLE_ON_VC_RELEASE to enable console Only on Debug build with VC.
/*! This shows console only when the engine is compiled on Debug build. Release build
wont have the console shown. Comment this line out to disable this feature which means
the console will always be shown. */
#define _NGE_DISABLE_CONSOLE_ON_VC_RELEASE
#if defined(_NGE_DISABLE_CONSOLE_ON_VC_RELEASE)
#	if(GAME_PLATFORM == PLATFORM_WIN32) && (GAME_COMPILER == COMPILER_MSVC)
#		if BUILD_TYPE == DEBUG_BUILD
#			pragma comment(linker, "/subsystem:console")
#		else
#			pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#		endif
#	endif
#endif
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Halifax wrote:Yes you can do it the way that dgrafix explained, or you can just do...Windows)
:lol:
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
twilight17
Posts: 362
Joined: Sun Dec 16, 2007 9:25 pm

Post by twilight17 »

MasterGod wrote:[helpful code]
Thanks MasterGod! Thats a good code snippet :wink:
Post this userbar I made on other websites to show your support for Irrlicht!
Image
http://img147.imageshack.us/img147/1261 ... wernq4.png
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

Thanks for the info. I solved adding to debug compilation

Code: Select all

/subsystem:console
and to de release compilation

Code: Select all

/subsystem:windows
/ENTRY:mainCRTStartup

Now, I got another problem. I have that error in debug mode. I was reading about it, and all says that I just could ignore it. Is there anyway to solve it?

Code: Select all

LIBC.lib(sbheap.obj)||warning LNK4099: PDB 'libc.pdb' was not found with 'C:\Archivos de programa\Microsoft Visual C++ Toolkit 2003\lib\LIBC.lib' or at 'D:\****\bin\Debug\libc.pdb'; linking object as if no debug info|
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

About the error. Clean the solution then compile again, it should fix it.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
fabs
Posts: 18
Joined: Sun Jun 25, 2006 1:41 pm

Post by fabs »

owned
nobleqiao
Posts: 5
Joined: Thu Jul 03, 2008 2:01 am
Location: China ChengDu

Excellent work

Post by nobleqiao »

Really Great Job :)
Freezing this summer
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

Post by stash »

Hey pelonzudo.. Your solution "
I solved adding to debug compilation
Code:

/subsystem:console

and to de release compilation
Code:

/subsystem:windows
/ENTRY:mainCRTStartup
"
it´s aplicable only for VC?

How can I solve this situation in CodeBlocks? Please, I need help.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Code::Blocks using what compiler?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

c::b should have a project setting which works compiler independent. Just read the docs.
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

Post by stash »

CB with MingW.
Post Reply