SFML community forums

Help => General => Topic started by: Dranz89 on June 24, 2016, 09:35:24 am

Title: Unresolved External Symbol???
Post by: Dranz89 on June 24, 2016, 09:35:24 am
Hello... I'm a relatively noob guy who wants to learn some C++, and I can't even get the tutorial working!
I was following the "Getting Started" Tutorial of "SFML and Visual Studio".

I don't know if you need this info but here comes:

So I figured I'd download SFML 2.3.2 for Visual C++ 14 (2015) - 64-bit. But when I tried to compile, the output I got said that module machine (x64) not compatible with x86... huh...

Then, I downloaded SFML 32-bit version, and it seemed like progress... but then I got the next error:


CodeDescriptionProjectFileLine
LNK2019unresolved external symbol _WinMain@16 referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ)
SFML_Tutorial01MSVCRTD.lib (exe_winmain.obj)1
LNK11201 Unresolved externals
SFML_Tutorial01SFML_Tutorial01.exe1

I think I'm doing something terribly wrong. Any help would be much appreciated.

EDIT: I think it's worth mentioning that the project doesn't even pass the building step.
Title: Re: Unresolved External Symbol???
Post by: Mr_Blame on June 24, 2016, 10:01:01 am
You should set subsystem parameter to console instead of windows.
Title: Re: Unresolved External Symbol???
Post by: G. on June 24, 2016, 10:05:54 am
Note that one solution is written in the very tutorial you're following. ;)

Quote from: http://www.sfml-dev.org/tutorials/2.3/start-vc.php
If you chose to create a "Windows application" project, the entry point of your code has to be set to "WinMain" instead of "main". Since it's Windows specific, and your code would therefore not compile on Linux or Mac OS X, SFML provides a way to keep a standard "main" entry point in this case: link your project to the sfml-main module ("sfml-main-d.lib" in Debug, "sfml-main.lib" in Release), the same way you linked sfml-graphics, sfml-window and sfml-system.