Hi,
I'm having a problem I don't know how to solve:
I have defined a public function into a class; this is the declaration:
TOM_ORDER_L* TOM_ExtraOps::get_ORDER_LVL_Pressed(double arg1, TOM_ORDER* order_dada);
The implementation header is exactly the same, but I'm having that error message:
'get_ORDER_LVL_Pressed' - function already defined and has different type TOM_ExtraOps.mqh 62 30
I don't understand how is it possible that having EXACTLY the same declaration and header in it's implementation, I'm getting that error; I don't know how to solve it.
Thanks in advance for any help/tip.
The declaration in the class should be:
class TOM_ExtraOps { public: TOM_ORDER_L* get_ORDER_LVL_Pressed(double arg1, TOM_ORDER* order_dada); };
and the function body should be:
TOM_ORDER_L* TOM_ExtraOps::get_ORDER_LVL_Pressed(double arg1, TOM_ORDER* order_dada)
{
...
}
- Alejandro Marin: I don't understand how is it possibleNeither can we. We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
- Per Petr Nosek's post, you don't need the variable names in the declaration, only in the function body.
public: TOM_ORDER_L* get_ORDER_LVL_Pressed(double, TOM_ORDER*);
Petr Nosek -> Arggggg I can't believe I didn't realise that. Absolutely right. Thanks!
- Neither can we.
We can't see your broken code.
There are no mind readers here and our crystal balls are cracked.
- Per Petr Nosek's post, you don't need the variable names in the declaration, only in the function body.
2. You don't need to, but it's best practice to include the variable names so your code is self documenting, something whroeder is constantly harping about
whroeder1:
Per Petr Nosek's post, you don't need the variable names in the declaration, only in the function body.
Yes, you are right and I know it. But in this case it is irrelevant. The important thing is that you must not use the scope resolution in the declaration in this case.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I'm having a problem I don't know how to solve:
I have defined a public function into a class; this is the declaration:
TOM_ORDER_L* TOM_ExtraOps::get_ORDER_LVL_Pressed(double arg1, TOM_ORDER* order_dada);
The implementation header is exactly the same, but I'm having that error message:
'get_ORDER_LVL_Pressed' - function already defined and has different type TOM_ExtraOps.mqh 62 30
I don't understand how is it possible that having EXACTLY the same declaration and header in it's implementation, I'm getting that error; I don't know how to solve it.
Thanks in advance for any help/tip.