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

Author Topic: Unresolved External Symbol???  (Read 4328 times)

0 Members and 1 Guest are viewing this topic.

Dranz89

  • Newbie
  • *
  • Posts: 1
    • View Profile
Unresolved External Symbol???
« 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:
  • Windows 8.1 (x64)
  • I'm using Microsoft Visual Studio Community 2015, Version 14.0.25123.00 Update 2
  • Visual C++ 2015

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.
« Last Edit: June 24, 2016, 09:36:55 am by Dranz89 »

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Unresolved External Symbol???
« Reply #1 on: June 24, 2016, 10:01:01 am »
You should set subsystem parameter to console instead of windows.

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Unresolved External Symbol???
« Reply #2 on: June 24, 2016, 10:05:54 am »
Note that one solution is written in the very tutorial you're following. ;)

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.

 

anything