Hi Coders,

I have build a library with code i can use in all my projects.
Some structs need types that are not always existing in the main project.

For example some main projects activate the DAC module, when the DAC module is activated the main project have a DAC_HandleTypeDef type.

My idea is to add members to the struct only if the type exist, so In my library's struct i use something like this :

Code:
#ifdef 	DAC_HandleTypeDef
	DAC_HandleTypeDef *pDAC_Speed;
#endif
Problem explination :
i Activate my DAC in the main project, i see that DAC_HandleTypeDef is defined in the mainproject. So far so good.
The problem is that my library code can't see the DAC_HandleTypeDef type, even while the library folders are included in the main project.
I would expect the main project headers are procecced before the libary headers, but that seems not to be the case. So the variable pDAC_Speed is not created as the precompiler thinks DAC_HandleTypeDef is not existing.

How do you guys organise/solve problems like this?

Thank you all