Ok,
Well, I found the solution. Sort of.
The problem was that I didn't link to the individual libraries. (This isn't covered in the Wiki).
So, I linked up what I thought were the correct libraries, and I was able to get the code to compile. The problem now, is that the program crashes on launch. I've tried compiling several different tutorial programs from several different sites. They all compile fine, but they all crash.
I think the problem still has to do with the libraries. See, there are DX9 libraries under /codeblocks/lib/, but there are also DX9 libraries under the directX installation directory. Which ones am I supposed to use?
However, they may not even be the problem. Mabey I'm using the wrong win32 libraries. I don't know. All of this is very new to me. Any suggestions?
You can be sure, once I have all this figured out, I'll be writing a detailed tutorial for the wiki on how to get DX9 running.
Thanks.