SFML community forums
Help => General => Topic started by: Kamaitachi on July 29, 2010, 02:47:51 pm
-
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:
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?
-
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.
-
Tried both methods. It didn't work.
-
Can you send me your project file (with the "fixes" included)?
-
Nevermind. I've solved the problem and the clock program compiled. However, when i tried to create a window, I got this errors:
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?
-
You must link to sfml-window.
-
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?
-
In debug configuration, you must link to the SFML debug libraries (-d suffix).
-
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: