The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[SDL2]-"printf" Not Printing To Command Prompt On
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
[SDL2]-"printf" Not Printing To Command Prompt On WinXP

Hi,

We started working on a new SDL2 2D shooter called: "Last Defense II 100%".
Our development environment is the following:
An Xubuntu 14.04 L.T.S. 64Bit host with Win XP Pro 32Bit guest in VirtualBox.

We are having a problem with printing game engine information to Command Prompt on Win XP.
The following line seems to not do anything?:
printf("JeZxLee's ''GT-R Twin TurboCharged'' game engine started!\n");

Is there something we must do to make "printf" print text to Command Prompt on Win XP?
Thanks in advance!

Here is a screenshot of development:
theGiallo


Joined: 03 Nov 2014
Posts: 11
Location: Genova, IT
If you are using VisualStudio you have to set the project to Win32 console. Maybe try to use SDL_LogInfo or SDL_Log
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
theGiallo wrote:
If you are using VisualStudio you have to set the project to Win32 console. Maybe try to use SDL_LogInfo or SDL_Log
Hi,

That worked!
We are using Code::Blocks and set project to "Console"
and now printf's work in Command Prompt on Win XP.

Thanks!
[SDL2]-"printf" Not Printing To Command Prompt On
Andreas Schiffler
Guest

FYI - the log functions will automatically attach to the console in Windows when a program was opened from the commandline.

/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
...
/* Log something */
SDL_Log("Something went wrong: %s\n", SDL_GetError());

On 12/8/2014 10:39 AM, JeZ-l-Lee wrote:

Quote:







theGiallo wrote: If you are using VisualStudio you have to set the project to Win32 console. Maybe try to use SDL_LogInfo or SDL_Log
Hi,

That worked!
We are using Code::Blocks and set project to "Console"
and now printf's work in Command Prompt on Win XP.

Thanks!



JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com


Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
[SDL2]-"printf" Not Printing To Command Prompt On
Jonas Kulla
Guest

Make sure you're compiling a console application (instead of a GUI one) by not passing

-mwindows to mingw, otherwise the app will detach itself from any console at startup.


2014-12-08 18:31 GMT+01:00 JeZ-l-Lee:
Quote:
[SDL2]-"printf" Not Printing To Command Prompt On WinXP

Hi,

We started working on a new SDL2 2D shooter called: "Last Defense II 100%".
Our development environment is the following:
An Xubuntu 14.04 L.T.S. 64Bit host with Win XP Pro 32Bit guest in VirtualBox.

We are having a problem with printing game engine information to Command Prompt on Win XP.
The following line seems to not do anything?:
printf("JeZxLee's ''GT-R Twin TurboCharged'' game engine started!\n");

Is there something we must do to make "printf" print text to Command Prompt on Win XP?
Thanks in advance!

Here is a screenshot of development:




JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Thank you, we have it working now...