Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Visual C++ 2010 - disable console?  (Read 1877 times)

0 Members and 1 Guest are viewing this topic.

Anthony11

  • Newbie
  • *
  • Posts: 38
    • View Profile
Visual C++ 2010 - disable console?
« 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
Re: Visual C++ 2010 - disable console?
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Anthony11

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Visual C++ 2010 - disable console?
« Reply #2 on: June 27, 2015, 01:32:39 am »
i only recently noticed the "main" lib, so thanks, i'll try that

DarkRoku12

  • Full Member
  • ***
  • Posts: 203
  • Lua coder.
    • View Profile
    • Email
Re: Visual C++ 2010 - disable console?
« Reply #3 on: June 27, 2015, 03:11:53 am »
I would like a spanish/latin community...
Problems building for Android? Look here

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Visual C++ 2010 - disable console?
« Reply #4 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

Not really a good solution since that is Windows specific.
Just use main() and link sfml-main as already said.