resolution of error.h in path

20 Feb 2013

Hi,

I'm messing around with an external library I'm trying to port which has it's own error.h.

It can resolve this without getting confused with the mbed one because it's located in some subdirectory/error.h

But in Thread.cpp and Mutex.cpp of mbed-rtos, error.h is included.

Unfortunately odd happens during compilation because of this and gives the problem:

Code

1 identifier "error" is undefined I can resolve this by renaming the error.h in the external library, and renaming all the necessary include statements in the external library: once there are no name clashes, the program compiles without a problem.

I assume that this has something to do with Thread.cpp and Mutex.cpp including the wrong error.h?

Another way around this would normally be to prefix the include with the directory. Does mbed stdlib error.h have a prefix I can use? (I tried mbed/error.h but that says no such file or directory). I guess the issue here is that there isn't an mbed directory as the core library is included in some kind of different format to usual. Although I can see an mbed directory if I export the program so I know it's there :)

Can anyone think of a way around this that doesn't require me renaming error.h in my included library and all the dependencies of it (if i port it, I want to make maintaining it easier).

Ashley