Can I seperately store the declaration of a class and impementation of the class into 2 files?

 

Can I store the declaration of a class into a .mqh file in include directory and store the implementation of the class into a .ex4 file in library directory?

I tried, but in the main file using  this class, all the member functions are compiled with errror "functon must have a body".

Then I searched in this forum, I found all the examples have class decaration and implementation in a single one .mqh file. 

Must declaration and  implementation of a class be in a single one .mqh file? Thank you!

 
aforexpert:

Can I store the declaration of a class into a .mqh file in include directory and store the implementation of the class into a .ex4 file in library directory?

I tried, but in the main file using  this class, all the member functions are compiled with errror "functon must have a body".

Then I searched in this forum, I found all the examples have class decaration and implementation in a single one .mqh file. 

Must declaration and  implementation of a class be in a single one .mqh file? Thank you!

I found a guide for moving class implementation to a library in article https://www.mql5.com/en/articles/362 

Promote Your Development Projects Using EX5 Libraries
Promote Your Development Projects Using EX5 Libraries
  • 2012.02.20
  • o_O
  • www.mql5.com
Hiding of the implementation details of classes/functions in an .ex5 file will enable you to share your know-how algorithms with other developers, set up common projects and promote them in the Web. And while the MetaQuotes team spares no effort to bring about the possibility of direct inheritance of ex5 library classes, we are going to implement it right now.
 
Ovo:

I found a guide for moving class implementation to a library in article https://www.mql5.com/en/articles/362 

Thank you, very much! ;)