SFML community forums

Help => General => Topic started by: Battleapple on December 13, 2013, 04:18:16 pm

Title: Visual Studio 13: error for main() and winmain()
Post by: Battleapple 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


Title: Visual Studio 13: error for main() and winmain()
Post by: Battleapple on December 13, 2013, 04:19:32 pm
And when i use WinMain() i get this error:

error LNK1561:Entry point must be defined
Title: Re: Visual Studio 13: error for main() and winmain()
Post by: eXpl0it3r 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?
Title: Re: Visual Studio 13: error for main() and winmain()
Post by: Laurent 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.
Title: Re: Visual Studio 13: error for main() and winmain()
Post by: Battleapple 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
Title: AW: Visual Studio 13: error for main() and winmain()
Post by: eXpl0it3r 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. ;)
Title: Re: Visual Studio 13: error for main() and winmain()
Post by: Battleapple 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.