Hi, first post here.
I know some of you might have seen this topic before. I have searched through the archives but I have never found anything that corresponds to my problem.
I have been trying to get SFML to work on VS 2010. Somedays it will work, but most of the time it wont. The problem is the linker. Since I'm not a pro by any means, I started programming in October and I'm currently on chapter 14 in C++ Primer Plus, I don't know what the problem is.
I have built he solution according to this video
http://www.youtube.com/watch?v=-uHGZGgMETg at 0:50. Then I have put the libs and dlls in VS' lib folder and the includes in the include folder. VS does recognize the headers, so that's no problem.
However at 3:16 he does something with the linker/input and this is where I think the problem occurs. Somedays typing sfml-graphics-s-d.lib works, and sometimes it wont. But this doesn't happen with system or window, only with graphics (I haven't tried the others).
with this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#include <SFML\Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "TEST");
sf::Event Event;
while(App.IsOpened())
{
while(App.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
App.Close();
}
App.Clear();
App.Display();
}
return EXIT_SUCCESS;
}
|
I get errors like these:
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@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: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEE
(and about 20 more like these)
I have also tried typing in sfml-graphics.dll in the linker/input, but that wont work either
I'd be terribly happy if someone knows what the deal is