SFML community forums

Help => General => Topic started by: Anthony11 on June 27, 2015, 01:13:48 am

Title: Visual C++ 2010 - disable console?
Post by: Anthony11 on June 27, 2015, 01:13:48 am
when i incorporate static SFML in Visual C++ 2010 (express edition), i was trying to make a release version without the console, so i set the system to WINDOWS (also tried NATIVE), and i switched the entry point to "main". the compile is successful but an unhandled error message shows... so is there any fix for this, or an alternative to make a consoleless build which works?
Title: Re: Visual C++ 2010 - disable console?
Post by: eXpl0it3r on June 27, 2015, 01:29:49 am
To remove the console, you simply set the subsystem to window and link against sfml-main all while using the main() function as entry point.

If you get an error you probably have another issue and without the actual error provided (nor debugged) we can't say what's it about. ;)
Title: Re: Visual C++ 2010 - disable console?
Post by: Anthony11 on June 27, 2015, 01:32:39 am
i only recently noticed the "main" lib, so thanks, i'll try that
Title: Re: Visual C++ 2010 - disable console?
Post by: DarkRoku12 on June 27, 2015, 03:11:53 am
You can use too:

FreeConsole()

https://msdn.microsoft.com/en-us/library/windows/desktop/ms683150(v=vs.85).aspx
 (https://msdn.microsoft.com/en-us/library/windows/desktop/ms683150(v=vs.85).aspx)
Title: Re: Visual C++ 2010 - disable console?
Post by: Jesper Juhl on June 27, 2015, 07:48:15 am
You can use too:

FreeConsole()
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683150(v=vs.85).aspx
 (https://msdn.microsoft.com/en-us/library/windows/desktop/ms683150(v=vs.85).aspx)
Not really a good solution since that is Windows specific.
Just use main() and link sfml-main as already said.