I have been looking up on this one for long, but I couldn't solve it.
What I have been trying to do is to "split" my source files into .h and .cpp files as conventionally done. Another thing I tried doing, as advised by another programmer, is including all the dependencies of a file within itself. The error I am getting is a "Multiple Definition of" type of error. The thing is I've been using the "#ifndef" pre-processor stuff to make sure everything is included only once, yet I am getting the Multiple Definition errors with functions and variables in those files 0_o. I already know I shouldn't include any .cpp inside any of the .h files nor should I define functions there. I have done a lot of research, but still can't seem to figure this one.
I am pretty sure I am doing wrong with the all including stuff; just couldn't figure out where >.<
I did. The source code was actually working and compiling perfectly before I did this splitting. Just double checked, and I am sure the SDL library is properly installed. It's actually the only external one I am using currently.
Just where am I doing wrong ?_? I did my best to follow Disch article and now this happens.
Go to the menu 'Project', select 'Porperties...'
A dialog 'Project/targets options' appears. Press the button 'Project's build options...'
A dialog 'Project build options' appears. Select the tab 'Linker settings'. What libraries appear in the list box 'Link libraries:'?
You might need to adjust the 'Search directories'/'Linker' there as well
Yes! You were right! I did have those in the global compiler settings, and I thought that would just be for every project. But once I did that in the Project's options, it compiled and linked perfectly!
On DevCpp the case was different though; it was just the IDE being stupid; I forgot to #include <algorithm> for std::sort in Interface.cpp
Anyway, this was quite weird and very unstable. Now I am facing a problem with C::B, and apparently, it is failing to read a file through fstream. Debugging and watching a string causes a segmentation fault immediately 0_o.
The same code compiles and works with DevCpp however. That iss getting off topic, so I might just start another thread.
Thank you very very much! I appreciate all your time and effort!