• Advertisement
Sign in to follow this  

[SDL] Console Application

This topic is 3228 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

Hello. I want to make a console application, and i need to use some SDL functions to get info from a bmp file easily, but when i compile with SDL the standar output goes to stdout.txt instead of the console output, and when i call system("pause"); all i get is the application to stunk (then i have to kill the process). The compiler takes the app as if a GUI application were. Please how can i use SDL in a console application. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Try setting the project subsystem to console? (Project, XYZ Properties, Configuration Properties, Linker, System, SubSystem = Console).

Share this post


Link to post
Share on other sites
Thanks but won't work

I started with a Console project and there pasted all the code. I have Code::Blocks and in the proyect options: Build Target - Release - Type: Console application, and it doesn't work properly.

anyways try it yourself, make a 10x10 monochrome bmp randomly filled and load it in a int array, then try to print in DOS (with printf or std::cout) the matrix with 0 and 1. (that's basically what i really need).

Share this post


Link to post
Share on other sites
Sorry, then, I've only used SDL in Visual C++ and it, well, just "works". I don't know what else to recommend, but this thread has some discussion with the problem.

Share this post


Link to post
Share on other sites
Thanks everyone, I got the output working properly, but there is still a problem: I can't use system calls like system("pause");. I think the problem is that I can't send keys to the application, and then when it says "press any key to continue..." the application doesn't get any key to continue.

I think ill try another way to input data (with the char** argv is a good idea) and get all in the stdout.txt or another file, it will take less time :/

Share this post


Link to post
Share on other sites
Quote:
Original post by GoldenPockets
Thanks everyone, I got the output working properly, but there is still a problem: I can't use system calls like system("pause");. I think the problem is that I can't send keys to the application, and then when it says "press any key to continue..." the application doesn't get any key to continue.

Most likely because you're having the same exact problem, but with stdin this time.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement