When I began dabbling in C, I would write directly with notepad and compile with DJGPP - this worked well enough for the extremely small programs that I wrote at home for my own amusement. Eventually, I worked out that for a graphical interaction with the use, I would use SDL. I discovered that DJGPP was not compatible with SDL, and hence I moved to MinGW.
After reading a few pages of a C SDL tutorial, I decided that notepad wasn't going to be the most efficient way forward - I went with the suggested program, Code::Blocks.
This is where the problems began. Even after several uninstalls/reinstalls and following step-by-step instructions, I am apparently not doing it right.
This is my latest attempt:
I'm running Windows XP.
First, I uninstalled all of the previously mentioned programs and deleted any remaining folders/files.
I downloaded codeblocks-8.02mingw-setup.exe, and installed it. I ticked the box so that it would automatically install MinGW, detect it, and set it as default.
I downloaded
SDL-devel-1.2.13-mingw32.tar.gz and extracted the archive into its own folder elsewhere on my system.
Then I followed the instructions given
here following "the good" instructions and then continuing down through "The Process".
I'll be verbose - for each step given, I'll say exactly what I did...
(Steps 1 and 2 are already covered with sufficient detail)
Step 3: Copy SDL.dll from inside the bin folder to the your compilers bin directory (ie C:\Mingw\bin) This allows the compiler to find the dll at runtime time without having to put it in the same folder as your program or in the windows folder.
I copied sdl.dll into C:\Program Files\CodeBlocks\MinGW\bin
Step 4: Copy the contents of lib to your compiler's lib folder. If MinGW is installed under C:\MinGW, then this will be C:\MinGW\lib.
Much like step 2, I copied the contents of the lib file in my SDL archive (three files - two .a's and one .la) into C:\Program Files\CodeBlocks\MinGW\lib
Step 5... it goes on like this.
I decided to perform the optional Step 6 - placing SDL.dll into C:\Windows
I have not yet tried to follow the "Alternative" method (listed under "the good").
Here's a screenshot of the final file structure (relevant, I hope)
That covers "The Good", and I move onto the bottom section, "The Process".
Following the given instructions, I start a new project with the SDL template.
It then asks me to provide the location of SDL on my computer - this doesn't seem to be mentioned in the guide at all. However, the window states 'this folder must contain the subfolders "include" and "lib" ' So I went with C:\Program Files\CodeBlocks\MinGW - it meets the stated requirements and I believe I had copied the necessary files into its subfolders.
Then the error message pops up:
Now, I've seen no mention of this header file up until now, so I'm totally stumped.
I'm doing it wrong - but how do I fix it?