Console Not Showing

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
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Console Not Showing

Post by einsteinsci »

I am trying to get through some of the tutorials, but whenever I try to use driverchoiceconsole(), nothing happens. I've gone through debug mode and found that driverchoiceconsole() is simply returning EDT_COUNT, but isn't displaying the choices. Up until this point, I have hard-coded the driver to OpenGL, but this time I want to get the console working. I created my project in VS2013 as a Win32 Project, with empty project selected in the wizard. Irrlicht works fine (when I hard-code it to OpenGL), but the console simply won't show up. I have searched this thoroughly in google and in these forums, and found nothing. What project settings / preprocessor directives do I need to do for the console to show up?
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Console Not Showing

Post by mikkis »

Right-click on your project, Properties -> Linker -> System and on the right side is SubSystem (you maybe have Windows choosed, change it to Console).
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Re: Console Not Showing

Post by einsteinsci »

Done. Still no effect. Do I have to re-create my project as a console application?
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Console Not Showing

Post by Granyte »

no but the main function has to be initiated a bit differently

this is how you initiate when you wanna run without the console

Code: Select all

int WINAPI WinMain(   HINSTANCE   hInstance,HINSTANCE   hPrevInstance,LPSTR   lpCmdLine,int nCmdShow){
and with it

Code: Select all

int _tmain(int argc, _TCHAR* argv[]){
Last edited by Granyte on Sun Dec 22, 2013 9:26 pm, edited 1 time in total.
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Re: Console Not Showing

Post by einsteinsci »

I created the next tutorial as a console application, but it's not showing up either. This is really wierd.

Here's what I'm testing (I have all the irrlicht headers and using's before this, and the include and lib folder set up):

Code: Select all

int main()
{
    system("cls");
    E_DRIVER_TYPE driverType = driverChoiceConsole();
    system("pause");
    cout << "TEST" << endl;
    system("pause");
 
    return 0;
}
What is expected is for the console to clear, the driver choice console to show up (or not), for it to wait for you, output "TEST\n", and wait for you again. Instead, I get the first wait message (I see a console window closing), then I press a key, I see another console window closing, and I get another wait message. "TEST\n" is not outputted.
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Re: Console Not Showing

Post by einsteinsci »

Granyte wrote:no but the main function has to be initiated a bit differently

this is how you initiate when you wanna run without the console

Code: Select all

int WINAPI WinMain(   HINSTANCE   hInstance,HINSTANCE   hPrevInstance,LPSTR   lpCmdLine,int nCmdShow){
and with it

Code: Select all

int _tmain(int argc, _TCHAR* argv[]){
I haven't been using WinMain or any win32 stuff. Just int main() as I did in console applications a few years ago.

Please note all of the projects so far work perfectly, except for the console behaving oddly.
einsteinsci
Posts: 10
Joined: Tue Nov 19, 2013 3:35 am

Re: Console Not Showing

Post by einsteinsci »

I've created my project as a console application, this time with all the default settings (not an empty project), and the console is working perfectly. Weird...
Post Reply