First game in sfml/c++

Pages: 12
I was wondering how much basic knowledge of c++ i'd have to know in order to start making very simple games in sfml with c++.
right now i know basic I/O, making programs with multiple files/forward declaration, constants, the different type of variables, enumerators, conditionals, and structs. i'm sure i know more than that but thats about the level of practice i have with c++, is this enough to start messing around with simple 2d games?
Good question, try it and find out. You probably won't break anything so I'm wondering why you don't just go a head and do it? We'll be here if you get stuck.
alright...
i do have one question real quick though.
i included "#include <SFML/Graphics.hpp>" and C::B is saying there's no such file or directory... i set my linker settings to include, graphics, window and system, as well as included the search directories SFML-x.y\include for the compiler and the SFML-x.y\lib for the linker but it doesn't work.
Just to make sure, you entered the FULL paths, right?
I hope that "x.y" are really "1.6", otherwise you're reading what ever tutorial you found too literally.

Double check your "include" directory, I know that silly mistake had me stuck with SFML for about 20 mins the first time around.
for the search directories?
on the sfml website, it said only to include simply "SFML-x.y\lib"
no path.
EDIT: thanks computer geek that was exactly what i did ahahahaha.
I just fixed it but no dice =(
Last edited on
hanst99 is right to, you need to include the full path. In Code::Blocks it's easier just to navigate out to the folder\file when you're linking them, that's what the elipse button to the right of the text box does [...].
alright, that did the trick, thanks guys.
hmm.. seems to be giving me an
"ld.exe||cannot find -l-lsfml-graphics|"
it isn't highlighting the #include like it did before but i won't let me compile... i'm trying to compile the source code on the tutorial so i know it isn't the code..
-lsfml-graphics
-lsfml-window
-lsfml-system

and also

-Wl,--enable-auto-import

The last one gets rid of this annoying warning that pops up when you're using Code::Blocks to work with files in SFML.
Last edited on
No, this means the compilation went fine, ld is the linker of gcc. Probably means your linker settings are still wrong.
i already put that in my link libraries, or do i have to put it in in the actual code or....?
As I said, it sounds like your lib path is still wrong.
Nope, libs aren't in the actual code, not the part diplayed on your IDE at least. I have to ask but are you trying to use GCC on Windows with out Cygwin?

i fixed the linker and now it compiles and opens but gives an error saying it cant find sfml-graphics.dll
i'm using windows but haven't seen anything about needing cygwin. why?
Last edited on
Nevermind what I said before, the Dll thing is different. You need to copy paste the dll files from the lib folder in the SFML download to either the file you're working on or the SYSTEMROOT directory.

EDIT: Either one will work but putting them in SYSTEMROOT would allow every application to access them.
Last edited on
alright, it's fixed. thanks!
Sorry to jump into this thread, but i'm having problems compiling my first program, heres what i did

<include> #iostream
using std namespace
main int() (
cout >> "Hello" >> end;
return 0
)
)
What did I do wrong?
There is no way in hell you are no troll.
What do you mean?
I'm a legitimate new users and I didn't want to make my own thread because you guys seemed like you know what you're talking about
I swear to God I'm not trolling
Pages: 12