I’m currently working on a project that has scope to become quite large, however being relatively new to C++ and coming from a Java background I’m not sure about the best way to proceed.
I would like to have a directory structure similar to:
+ Root
- main.cpp
+ Engine
+ Core
- foo.cpp
- foo.h
+ Utilities
- bar.cpp
- bar.h
+ Sound
+ Input
+ Collision Detection
+ Particle System
At the moment I have a load of .ccp/.h files sitting in the Engine directory. When I move them to their appropriate folders and try to tie them together I just get pages of compile errors relating to classes being undefined. Can some kind soul help point a novice in the right direction?!
You’re almost certainly having trouble with include files being included. You need to add to the compile command -I flags for the directories from which you’re bringing in your .h files.
Several of your directory names have spaces in them, so be careful that you’re quoting the directory names correctly. Or, even better, since that’s often a major pain, change, eg, “Collision Detection” to be “CollisionDetection” or “Collision_Detection”