Page 1 of 1

Issue with SFML

Posted: Sun Apr 11, 2010 5:53 pm
by jacob.krustchinsky
I followed the tutorial form start to finished and still recieved these errors when I tried to compile their "Opening a window" code.

Code: Select all

1>------ Build started: Project: AppleSauce, Configuration: Debug Win32 ------
1>Compiling...
1>Engine.cpp
1>Linking...
1>Engine.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>Engine.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>Engine.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>Engine.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\Jacob\Documents\Visual Studio 2008\Projects\AppleSauce\Debug\AppleSauce.exe : fatal error LNK1120: 4 unresolved externals
1>Build log was saved at "file://c:\Users\Jacob\Documents\Visual Studio 2008\Projects\AppleSauce\AppleSauce\Debug\BuildLog.htm"
1>AppleSauce - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Re: Issue with SFML

Posted: Sun Apr 11, 2010 6:20 pm
by lotios611
Did you add "sfml-window-d.lib" to your linker?

Re: Issue with SFML

Posted: Sun Apr 11, 2010 6:20 pm
by XianForce
Looks like you didn't link against the correct libraries to me. Are you sure you set up the project to link against the SFML lib(s)?

Re: Issue with SFML

Posted: Sun Apr 11, 2010 6:23 pm
by Ginto8
from what I can see you haven't linked the executable to a required DLL ;)

Re: Issue with SFML

Posted: Sun Apr 11, 2010 6:40 pm
by jacob.krustchinsky
Screw it. Back to SDL, I added the sfml-window to the linker and still got a hand full of errors.

Re: Issue with SFML

Posted: Sun Apr 11, 2010 6:55 pm
by Live-Dimension
Why quit so early? SFML is quite good, there's just a small config error on your part.

Re: Issue with SFML

Posted: Sun Apr 11, 2010 7:50 pm
by Ginto8
Live-Dimension wrote:Why quit so early? SFML is quite good, there's just a small config error on your part.
I agree. One small issue and you quit? That's not the kind of spirit a programmer should have.

Re: Issue with SFML

Posted: Sun Apr 11, 2010 9:38 pm
by jacob.krustchinsky
Im not trying to make it seem like I am a quitter, I just dont have the time to tweak and troubleshoot. I read up on SFML and decided to spend today playing with it, it didnt work so I will stick with what I know for now.

Re: Issue with SFML

Posted: Mon Apr 12, 2010 3:12 am
by LeonBlade
jacob.krustchinsky wrote:Im not trying to make it seem like I am a quitter, I just dont have the time to tweak and troubleshoot. I read up on SFML and decided to spend today playing with it, it didnt work so I will stick with what I know for now.
Pleeeasseeee don't do this :nono:
Go and re-download the libraries again.
Try something simple... make sure you add the proper linking shit and see what happens.
Honestly, don't give up on it. SFML is better than SDL you'll be happy when you get it going ;)

Re: Issue with SFML

Posted: Mon Apr 12, 2010 3:46 am
by K-Bal
Post the new errors and we can help you.

Re: Issue with SFML

Posted: Mon Apr 12, 2010 7:08 am
by dejai
I am using SFML on my current project, I have had the exact same error just look up LNK2019 and it will clear everything up. I can see how (__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 would be off putting but is just the linker throwing a spaz attack since you have not told it where everything is... I think the tutorials are out of date which my be why your setup is giving you the errors check the readme in the SDK.

Re: Issue with SFML

Posted: Mon Apr 12, 2010 8:00 am
by K-Bal
Even if the tutorials are not up to date (I don't know), linking to libraries is absolutely basic programming knowledge. It is always almost the same. Remember to not link debug libraries in release mode or vice versa.

The only issue with SFML is that you have to define SFML_DYNAMIC when linking dynamically on Windows. Apart from that SFML links just like every other library.

Re: Issue with SFML

Posted: Mon Apr 12, 2010 9:17 am
by short
link statically if you can't figure out how to do it dynamically