954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Removing Console Window with SFML

Hi,
I'm learning to use the Simple, Fast, Multimedia Library (or SFML), and I was going through the tutorials on their website. The first one (found here ) said the following:
Under Windows operating systems, you may have created a "Windows Application" project, especially if don't want the console to show up. In such case, to avoid replacing main by WinMain, you can link with SFML_Main static library and keep a standard and portable main entry point.
I have no idea what this means. When I run the .cpp file that you can download at the bottom of the page, it creates 2 windows: the application window and a console window. My questions are:
1. What is a static library, and how do I link it?
2. Which should I include in my program: main(), WinMain(), SFML_Main or a mix?

Additional information: I'm using the Code::Blocks IDE and I'm running it on Windows 7.

Chuckleluck
Junior Poster in Training
54 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

A static library is the opposite of a DLL (dynamic link library).
They mean you can add their library to your linker step.
That way, it will resolve the main/WinMain problem that may have been created by the project type you used for your application.

The static library will usually be a .LIB file (but can also be a .OBJ).

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

Thank you, but what about my second question: which functions (main, WinMain, SFML_Main) must/should I include? And if I need to include SFML_Main plus main or WinMain, will the program flow begin at SFML_Main, or at the other function (main/WinMain)?

Chuckleluck
Junior Poster in Training
54 posts since Sep 2011
Reputation Points: 10
Solved Threads: 1
 

How will the program be started (command-line, Windows or SFML instance)?
I woud imagine, if you need the SFML Main, that one HAS to be the only main.

thines01
Postaholic
Team Colleague
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: