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

Author Topic: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStar  (Read 5087 times)

0 Members and 1 Guest are viewing this topic.

FoamyPop

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email

Here is the github page with my code:
https://github.com/FoamyPop/Arctic

LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

Subsystem is set to console

:( Halp

Linked to:
sfml-window-s.lib
sfml-graphics-s.lib
sfml-system-s.lib
sfml-main.lib
« Last Edit: January 09, 2013, 01:29:01 am by FoamyPop »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Subsystem is set to console

sfml-main.lib
If you link against sfml-main, then you have to set the subsystem to window or if you set it to console you can't link against sfml-main.

Also 'Halp' is not a word...
And using the default font of the forum is better than using your user-defined one. ;)
« Last Edit: January 09, 2013, 01:15:14 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FoamyPop

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Okay, now I have changed the subsystem to windows, and I am receiving this error:

error LNK2019: unresolved external symbol _main referenced in function _WinMain@16

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Which compiler are you using? How did you setup your IDE?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FoamyPop

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Visual Studio 2012

> The directories are set up
> Pre processor is SFML_STATIC;
> Multithreaded DLL


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Well you must have done something wrong along the way...

If you link against sfml-main with subsystem window or don't link with console and define a int main() then everything should be okay. Never had problems before, neither with VS2010 nor VS2012.

Did you follow the official tutorial? Specially did you start with an empty project and not with a Win32 project?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FoamyPop

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
yeah, i made an empty one. should I be using SFML 2? i have been using sfml 1-6

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
yeah, i made an empty one.
I don't really know then, maybe create a new one following 1:1 the tutorial, or Google more on the topic. :-\

should I be using SFML 2? i have been using sfml 1-6
Yes! Definitely! :)
SFML 1.6 hasn't been touched in 2.5 years, has a few nasty bugs and lacks quite a few nice features (e.g. sf::VertexArray, sf::RenderTexture).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FoamyPop

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Okay! thanks a lot for the help