Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error in autotension.cpp #26

Open
MartijnZ opened this issue Sep 14, 2016 · 1 comment
Open

Build error in autotension.cpp #26

MartijnZ opened this issue Sep 14, 2016 · 1 comment

Comments

@MartijnZ
Copy link

MartijnZ commented Sep 14, 2016

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

@amyblank
Copy link
Contributor

Thank you for bringing this to our attention!

We recently moved our libbarrett development to a new location: https://git.barrett.com/software/libbarrett

Further development, including this bug fix, will show up there. We will try to keep GitHub up to date as we release new versions of libbarrett, but if you're interested in seeing the latest development as it happens, please check out the new link. Some of the highlights: the latest version uses Eigen3 instead of Eigen2, and we're working towards supporting Ubuntu 14.04 (pending testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants