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

Author Topic: Visual Studio 13: error for main() and winmain()  (Read 2898 times)

0 Members and 2 Guests are viewing this topic.

Battleapple

  • Newbie
  • *
  • Posts: 10
    • View Profile
Visual Studio 13: error for main() and winmain()
« on: December 13, 2013, 04:18:16 pm »
When i try to use the main() function i get that error:

error LNK 2019

5 times the problem is a "reference to a not solved extern symbol  "
with following code following:

1.__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z)" in Funktion "_main".

3.__declspec(dllimport) public: bool __thiscall sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QBE_NXZ)" in Funktion "_main"

4.__declspec(dllimport) public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z)" in Funktion "_main"

2.error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""__declspec(dllimport) public: void __thiscall sf::Window::close(void)" (__imp_?close@Window@sf@@QAEXXZ)" in Funktion "_main"

5."__declspec(dllimport) public: void __thiscall sf::Window::display(void)" (__imp_?display@Window@sf@@QAEXXZ)" in Funktion "_main".   C:\U



Battleapple

  • Newbie
  • *
  • Posts: 10
    • View Profile
Visual Studio 13: error for main() and winmain()
« Reply #1 on: December 13, 2013, 04:19:32 pm »
And when i use WinMain() i get this error:

error LNK1561:Entry point must be defined

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Visual Studio 13: error for main() and winmain()
« Reply #2 on: December 13, 2013, 04:36:53 pm »
Visual Studio 13 doesn't exist. It's either VS 12 or VS 2013 (yeah I know it's confusing - thank Microsoft). ;)

For VS 2013 there aren't any precompiled libraries, thus have you built SFML on your own?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Visual Studio 13: error for main() and winmain()
« Reply #3 on: December 13, 2013, 05:52:14 pm »
Quote
Visual Studio 13 doesn't exist. It's either VS 12 or VS 2013 (yeah I know it's confusing - thank Microsoft).
This is the most confusing thing I've ever seen ;D

Visual Studio 2013 does exist, and the other thing is VC++ 12.
Laurent Gomila - SFML developer

Battleapple

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Visual Studio 13: error for main() and winmain()
« Reply #4 on: December 13, 2013, 07:59:51 pm »
Visual Studio 13 doesn't exist. It's either VS 12 or VS 2013 (yeah I know it's confusing - thank Microsoft). ;)

For VS 2013 there aren't any precompiled libraries, thus have you built SFML on your own?

Yes I have built it on my own

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Visual Studio 13: error for main() and winmain()
« Reply #5 on: December 13, 2013, 09:09:16 pm »
Are you then following the tutorial step by step?
Can you provide the full build command (see sticky thread)?

You most likely are linking something wrong. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Battleapple

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Visual Studio 13: error for main() and winmain()
« Reply #6 on: December 14, 2013, 04:55:23 pm »
I think my mistake was to not include some dependencies  :o
I recompiled it and now it works
(seems like all of my forum posts so far were senseless :( )

Thank you for the fast reply.

 

anything