windows game

Started by
3 comments, last by Alberth 1 year, 3 months ago

If I want to make a new game for Windows, should I use SFML or SDL?

Thank you.

Advertisement

Yes.

Both are fine. You may want to look at what each library provides and pick the one that fits best to your needs. Chances are even that doesn't differ much, in that case just pick one.

@Alberth Thanks for replying.

Unfortunately, I'm getting some errors when trying to build the tutorial:

Severity Code Description Project File Line Suppression State

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QEAA@PEBDAEBVlocale@std@@@Z) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl sf::String::~String(void)" (__imp_??1String@sf@@QEAA@XZ) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QEAA@III@Z) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::Window::close(void)" (__imp_?close@Window@sf@@QEAAXXZ) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: bool __cdecl sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QEBA_NXZ) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: bool __cdecl sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QEAA_NAEAVEvent@2@@Z) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::Window::display(void)" (__imp_?display@Window@sf@@QEAAXXZ) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __cdecl sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (__imp_??0Color@sf@@QEAA@EEEE@Z) referenced in function main SFMLtest C:\Users\mike7\source\repos\SFMLtest\SFMLtest\Source.obj 1

Any idea how to fix these errors?

Thanks.

@ms75214 Looks like linking errors. The compiler tries to connect the library code with your program, but it's missing the library file.

As for solving, I can give you a working g++ command-line (I am a Linux user), but that won't do much good at a Windows system.

So instead, try to find a tutorial about installing a 3rd-party library in your IDE. If you're lucky one for SFML exists, although the procedure is the same for all libraries Ii guess.

EDIT: missing the file or not recognizing it (was it built with a compatible compiler?)

This topic is closed to new replies.

Advertisement