Personal tools
You are here: Home Forums The Basement Workshop Using sfr26a.h causes redeclaration errors

Using sfr26a.h causes redeclaration errors

Up to The Basement Workshop

Using sfr26a.h causes redeclaration errors

Posted by David V. Fansler at February 17. 2008

Continuing to work on my project based on the qsk26a board, I got my graphics display working.  I next have added UART0 code by creating a new c module with the uart code inside.  I included “#include “sfr26a.h” “ in the c module (which the same include is in another module).  When compiling I am getting redeclaration errors in the sfr26a.h file.  I need the sfr26a.h in both modules, how do I keep the complier from trying to redeclare the items twice?

Thanks,
David

Re: Using sfr26a.h causes redeclaration errors

Posted by Calvin Grier at February 18. 2008

Check to make sure the header files themselves are not using the #include "sfr26a.h"...

It should only appear once per C file. If the header files include it too, you get errors.

Re: Using sfr26a.h causes redeclaration errors

Posted by David V. Fansler at February 18. 2008

That did it!  My son had me try putting the #ifndef/#define/#endif statement in the srf32a.h file, but stated that putting it in a compiler generated file did not seem right.

Thanks for you help Calvin.

David

Powered by Ploneboard