#include files and the "function already defined & has body" error message.

 
Morning,

So I've started using include files in order to reduce the duplication of regularly-used block of code & which are not dependent on each other. 

However, I am getting the
'oninit' - function already defined and has body        diagnostics.mqh 5       7
   see previous declaration of function 'oninit'        close_button.mqh        5       7
'ondeinit' - function already defined and has body      diagnostics.mqh 33      7
   see previous declaration of function 'ondeinit'      close_button.mqh        48      7

message upon compiling the EA (MQ4 file).

I can see and understand why I'm getting these message & in a way it's a good thing because it means my EA is reading my #include files correctly, but when I delete the function(s) in the #include files, it returns the 

event handling function not found

message. I can understand why these error messages are returning but surely there must be a solution to this error cycle, it doesn't like there being two event handling function and it it doesn't like there being no event handling function.

Much obliged & all the best, 

 

You don't have any "event handling functions."

The oninit and ondeinit are defined in your include files. Those are functions or methods, not event handlers.

The event handles (Event Handling Functions - Functions - Language Basics - MQL4 Reference) are not spelled like those.

 
William Roeder #:

You don't have any "event handling functions."

The oninit and ondeinit are defined in your include files. Those are functions or methods, not event handlers.

The event handles (Event Handling Functions - Functions - Language Basics - MQL4 Reference) are not spelled like those.

oook...