I am just starting to use SFML to develop a simple game. The first part of it involves a little bit of initialization and then it starts to display credits. When I try to compile it to test it, I get an error from ld that states:
obj\Release\main.o:main.cpp: (.text+0x29b): undefined reference to 'credits(sf::RenderWindow&)'
collect2: ld returned 1 exit status
I have it added into the C::B IDE project. I did some research and I found that it might have something to do with the Makefile, but I don't know what.
No... you create either a header or implicitly resolve the reference by linking (where the latter is illegal in C++ since everything needs an explicit declaration), you don't include implementation directly. It's hard on parsing and bad design.
I have found a solution to the issue, when I go to my project properties, I find a list of all of my files with check boxes next to them. The box is titled build targets. My guess is that it wasn't including the files in the project build even though I imported them into the project. After checking the unchecked files, it compiles properly. I don't like the simplicity of the solution, so no doubt I will be learning how to deal with the makefile for future references. Thanks everyone.