First, including isn't the same as linking. Read this depending on your OS and IDE: http://www.lazyfoo.net/SDL_tutorials/lesson01/index.php
Second, I've never seen a .cpp included. Just include headers because those contain your function prototypes.
In general you shouldn't be including .cpp files. You want to put the function prototypes in a header file and define them in their respective .cpp file. Then if you need to use those functions, you just include the header that has their prototypes.
I think the only time you might have to include a .cpp is if your using templates inside it.
I would, but the files are incredibly huge, and they compile under gcc, so I would assume the problem is codeblocks specific. I have the file as a GUI application, and the linker settings are -lmingw32 -lSDLmain -lSDL -lSDL_image.
in main i am including the .cpp's and in the .cpp's I am including the .h. I don't know why this works in gcc, but if I switch it so main includes .h's it doesn't work.
Well I have to admit I haven't used extern before so I'm not familiar with how it works, perhaps it's the problem. You should really be using classes and put your globals in a namespace.
I had this project working in codeblocks before then I added a new header and a new .cpp, and all the errors are with including them. I did have to switch the files in main to .h
mary wrote:if I have main.cpp linking to class1.h, wouldn't I need class1.h to link to class1.cpp to work?
What?
class1.h is its own standalone file, it prototypes whatever you want
class1.cpp is the implementation of class1's prototype. It MUST include class1.h
main.cpp this just includes class1.h