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

Author Topic: Compiling as Windows vs Console application  (Read 959 times)

0 Members and 1 Guest are viewing this topic.

YetiRevolution

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compiling as Windows vs Console application
« on: September 29, 2013, 09:14:19 am »
Hi, I'm rather new to C++ on Windows, and Visual Studio in general, so I apologize if this question is silly.

Basically, I'm having an issue compiling as a /SUBSYSTEM:WINDOWS application. I can compile easily when I select /SUBSYSTEM:CONSOLE, but for some reason this gives me errors when using other libraries (i.e. ClipperLib). The error I'm getting under /SUBSYSTEM:WINDOWS is a linker error:

Quote
Error   1   error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartu

I've googled around, and all the solutions say to switch back to /SUBSYSTEM:CONSOLE. Is there any way to avoid this? Thanks in advance for any help!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Compiling as Windows vs Console application
« Reply #1 on: September 29, 2013, 09:31:30 am »
Your entry point must become WinMain instead of main, or if you don't want to add non-standard stuff to your code, you can link to the sfml-main library, as explained in the tutorial.
Laurent Gomila - SFML developer

YetiRevolution

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Compiling as Windows vs Console application
« Reply #2 on: September 29, 2013, 10:42:31 pm »
Thanks a ton, that worked perfectly!