I have a problem about spreading my code into several different files and then trying to compile.
After prototyping some code in 1 file and successfully compiling and running it, I thought it was time to modularise and object orientate my work. However, Dev-c++ can't seem to find the other files.
I have 3 files: 1 Map.h, 2 Map.cpp, 3 Main.cpp
The Map* files make up a class that I use in Main. All files are in the same directory and added to the project. But when compiling, it complains 'Map' undeclared (first use this function)
Has anyone had this problem before?
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey all,
I have a problem about spreading my code into several different files and then trying to compile.
After prototyping some code in 1 file and successfully compiling and running it, I thought it was time to modularise and object orientate my work. However, Dev-c++ can't seem to find the other files.
I have 3 files: 1 Map.h, 2 Map.cpp, 3 Main.cpp
The Map* files make up a class that I use in Main. All files are in the same directory and added to the project. But when compiling, it complains 'Map' undeclared (first use this function)
Has anyone had this problem before?
Thanks.
Actually, I just solved it.
Don't know if it matters but:
1. I created an empty project instead of the usual windows application
2. I made my header file a .hpp file instead of .h
As long as it works, I am happy!