Hi,
First I wanna warn you that my english little sucks, so don't judge me please :)
I've just started to learn 2D programming, and I have little problem, I did everything like it says in this tut;
http://www.sfml-dev.org/tutorials/1.6/start-vc.php
console and that timer was working good, then I wanted to do this:
http://www.sfml-dev.org/tutorials/1.6/window-window.php
and then I was getting error, so I googled something (I can't remember it) and found this video:
http://vimeo.com/12544814 I did everything like he did + copied new libs and includes to VC folder, then I tried to make new blank window again (
http://www.sfml-dev.org/tutorials/1.6/window-window.php )
I've tried it with empty win32 project, and windows forms application
win32 empty project (no stdafx included)
1 2 3 4 5 6 7
|
1
|
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Window::~Window(void)" (??1Window@sf@@UAE@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "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 &)" (??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>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>c:\users\mekkatorqu\documents\visual studio 2010\Projects\dasa\Debug\dasa.exe : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
bool Running = true;
while (Running)
{
App.Display();
}
return EXIT_SUCCESS;
}
|
and in win forms app this:
1 2 3 4 5 6 7 8 9 10 11 12
|
1
|
1>ddd.obj : error LNK2028: unresolved token (0A00001B) "public: void __clrcall sf::Window::Display(void)" (?Display@Window@sf@@$$FQAMXXZ) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2028: unresolved token (0A00001C) "public: void __clrcall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (?Create@Window@sf@@$$FQAMXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@2@@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2028: unresolved token (0A00001D) "public: virtual __clrcall sf::Window::~Window(void)" (??1Window@sf@@$$FUAM@XZ) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2028: unresolved token (0A00001E) "public: __clrcall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@$$FQAM@III@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2028: unresolved token (0A00001F) "public: __clrcall 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 &)" (??0Window@sf@@$$FQAM@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2019: unresolved external symbol "public: virtual __clrcall sf::Window::~Window(void)" (??1Window@sf@@$$FUAM@XZ) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2019: unresolved external symbol "public: void __clrcall sf::Window::Display(void)" (?Display@Window@sf@@$$FQAMXXZ) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2019: unresolved external symbol "public: void __clrcall sf::Window::Create(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (?Create@Window@sf@@$$FQAMXVVideoMode@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@2@@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2019: unresolved external symbol "public: __clrcall 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 &)" (??0Window@sf@@$$FQAM@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>ddd.obj : error LNK2019: unresolved external symbol "public: __clrcall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@$$FQAM@III@Z) referenced in function "int __clrcall main(void)" (?main@@$$HYMHXZ)
1>c:\users\mekkatorqu\documents\visual studio 2010\Projects\ddd\Debug\ddd.exe : fatal error LNK1120: 10 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
almost same code, but included stdafx and form1.h
I'm really just beginner :)
+ I really don't understand this part:
Under Windows operating systems, you may have created a "Windows Application" project, especially if don't want the console to show up. In such case, to avoid replacing main by WinMain, you can link with SFML_Main static library and keep a standard and portable main entry point. |
I've tried int WinMain but I was getting error too...
I'm using microsoft visual studio 2010 express, and please, don't tell me to link with SFML_Main static library cuz I have no idea what does it means :(
edit:
I have this: linker > input > add depen: sfml-system-s.lib;sfml-main.lib;%(AdditionalDependencies)
C/C++ > general > add includes > C:\Users\Mekkatorqu\Desktop\SFML-1.6\include;%(AdditionalIncludeDirectories)
linker > general > add libs > C:\Users\Mekkatorqu\Desktop\SFML-1.6\lib\vc2010;%(AdditionalLibraryDirectories)
and I'm still getting that first error in empty win32 application