kHi,
Today I compiled libbarrett and I ran into the following compile error:
libbarrett/programs/autotension.cpp:553:63: error: redeclaration of ‘bool AutoTension<DOF>::engage(int, double)’ may not have default arguments [-fpermissive]
bool AutoTension<DOF>::engage(int motor, double timeout = 20.0) {
This error occurs because the default value for the argument timeout is in the function definition instead of the function declaration. From cppreference.com:
For member functions of class templates, all defaults must be provided in the initial declaration of the member function.
When changing the function declaration to (line 215)
bool engage(int motor, double timeout=20.0);
And removing the default value from the function definition (line 553):
template<size_t DOF>
bool AutoTension<DOF>::engage(int motor, double timeout) {
The problem was resolved.
Note that I'm used GCC 5.4.0 to compile
kHi,
Today I compiled libbarrett and I ran into the following compile error:
This error occurs because the default value for the argument
timeoutis in the function definition instead of the function declaration. From cppreference.com:When changing the function declaration to (line 215)
And removing the default value from the function definition (line 553):
The problem was resolved.
Note that I'm used GCC 5.4.0 to compile