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

Author Topic: VC2010 problem-unresolved external symbol _WinMainCRTStartup  (Read 6648 times)

0 Members and 1 Guest are viewing this topic.

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
I have installed SFML and tried to compile the Clock program shown in the tutorial page, but VC2010 returned this error while building the project:

Code: [Select]
1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
1>C:\Users\Mkh\Documents\Visual Studio 2010\Projects\SFML_Test2\Debug\SFML_Test2.exe : fatal error LNK1120: 1 unresolved externals


How I solve it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #1 on: July 29, 2010, 03:11:39 pm »
Your project is defined as a "Win32 application", so it requires a WinMain entry point instead of the standard main. You must change the settings to "console application" (in linker -> system -> sub-system), or link to sfml-main if you don't want a console.
Laurent Gomila - SFML developer

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #2 on: July 30, 2010, 10:58:46 am »
Tried both methods. It didn't work.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #3 on: July 30, 2010, 12:29:43 pm »
Can you send me your project file (with the "fixes" included)?
Laurent Gomila - SFML developer

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #4 on: August 01, 2010, 10:46:38 pm »
Nevermind. I've solved the problem and the clock program compiled. However, when i tried to create a window, I got this errors:

Code: [Select]
1>------ Build started: Project: SFML1, Configuration: Debug Win32 ------
1>SFML1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall sf::Window::~Window(void)" (__imp_??1Window@sf@@UAE@XZ) referenced in function _main
1>SFML1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Window::Display(void)" (__imp_?Display@Window@sf@@QAEXXZ) referenced in function _main
1>SFML1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Window::Window(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (__imp_??0Window@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function _main
1>SFML1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>c:\users\mkh\documents\visual studio 2010\Projects\SFML1\Debug\SFML1.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Any solution?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #5 on: August 01, 2010, 11:12:15 pm »
You must link to sfml-window.
Laurent Gomila - SFML developer

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #6 on: August 02, 2010, 07:34:37 pm »
Heh, thank you. Should've thought of that. Anyway, now I tried to compile the rendering windows program, linked sfml-graphics, copy&pasted the code, still, VC2010 returned me this error:

"A buffer overrun has occurred in SFML1.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."

And:

"A buffer overrun has occurred in SFML1.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program.

For more details please see Help topic 'How to debug Buffer Overrun Issues'."

And:

"SFML1.exe has triggered a breakpoint"

How can I solve this?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #7 on: August 02, 2010, 08:10:15 pm »
In debug configuration, you must link to the SFML debug libraries (-d suffix).
Laurent Gomila - SFML developer

Kamaitachi

  • Newbie
  • *
  • Posts: 28
    • View Profile
VC2010 problem-unresolved external symbol _WinMainCRTStartup
« Reply #8 on: August 17, 2010, 05:19:13 pm »
Oh well. After a break, I've returned to SFML. I started using the CodeBlocks IDE and now things are going smoothly. Anyway, I just want to thank you for your help  :lol: