How can I avoid explicitly declaring directory paths in C or C++ #include directives?
- by user269037
Hi,
I am making a simulator and have written lots of files and headers. The problem is whenever I include a file I give the relative path of the particular file. For example a typical code in my application would begin like
#ifndef AI_H
#define AI_H
#include <cstdlib>
#include "../world/world.h"
#include "pathPlan.h"
#include "skills/tryskill.h"
#include "../info/condition.h"
#include "dataStructures/destination.h"
#include "../params/gamePlay.h"
#include "../modules/controlModule.h"
class ai
{
public:
etc etc
I want to avoid using the relative paths. For example I want to directly include "tryskill.h" and "destination.h" without giving the absolute paths. That way I wont need to bother if I change the location of any particular file. I am using Ubuntu 9.10. Any help would be highly appreciated.