How to create basic graphics in c++?

Aug 16, 2015 at 3:26pm
So I am fairly new to c++ and have got a grip of the basics of the language, enough to make some pretty simple number guessing games and interactive text adventure things, however, I am trying to now go into the realm of making a 2d graphics window, and simply making a character move about on the screen. Can anyone possibly explain the real fundamental basics I'll need to know, or does anyone have a link to ay videos which they found helpful when learning?
I seriously know nothing about making graphics yet, so please be patient!
Aug 16, 2015 at 4:51pm
try to use sfml, i heard it's pretty easy to use

http://www.sfml-dev.org/
Aug 16, 2015 at 5:41pm
I currently use codeblocks for c++. Is this a separate program, or something I will need to install and place into codeblocks?
Aug 16, 2015 at 6:12pm
SFML is a library that you link to in your project settings. There is a tutorial on the sfml website of how to set it up with Code::Blocks. Once you've done that, you include the appropriate module with a #include statement and then you can use all its functionality which is stored in the sf:: namespace. The tutorials are extensive and the API documentation even more so. Also, just a btw, but it is often said (especially on the SFML forums) that most video tutorials are a lot worse than written ones, internet or book, as often or not the tutor doesn't know what they're doing and there are a lot of bad habits taught in video tutorials.
Aug 16, 2015 at 6:37pm
aaannd its broken.
Aug 16, 2015 at 6:38pm
just followed the tutorial step by step, every-time I try to build & run it says "It seems the project has not been built yet. Would you like to build it now?"
Aug 16, 2015 at 6:44pm
Okay..now its no longer coming up with that error, but instead saying undefined reference to sf::String::String(char const*, std::locale const&)
Aug 16, 2015 at 7:58pm
Undefined reference almost always means you've linked it wrong. The most common reasons for this are: downloading the wrong version of SFML (it must exactly match your compiler version), if linking statically, you must define SFML_STATIC, else you have to put the right dlls in the folder. You must correctly specify suffixes when linking (-s and/or -d) as in the tutorials and linking order does matter. Finally, if linking statically, you need to link to the dependencies.
Aug 16, 2015 at 9:51pm
Shadowmouse, you wouldnt mind taking a look at this thread for me would you, this is the problem I'm having now, hoping you can help!!
http://www.cplusplus.com/forum/beginner/171676/
Topic archived. No new replies allowed.