-
Notifications
You must be signed in to change notification settings - Fork 2
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
API miss-matching #3
Comments
It works perfetly on my side. What compiler do you use? You can eventually add You can also try this: return { position, rotation, p, mu, nrGenerators }; or this return wcl::ContactSurface{position, rotation, p, mu, nrGenerators}; |
Actually I already added
I tried both of the modifications but end up with errors:
In function ‘wcl::ContactSurface wcl::rectangularSurface(double, double, const Vector3d&, const Matrix3d&, double, unsigned int)’:
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:33:71: error: no matching function for call to ‘wcl::ContactSurface::ContactSurface(<brace-enclosed initializer list>)’
return wcl::ContactSurface{position, rotation, p, mu, nrGenerators};
^
In file included from /home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:19:0:
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface()
struct WCL_DLLAPI ContactSurface {
^
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate expects 0 arguments, 5 provided
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface(const wcl::ContactSurface&)
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate expects 1 argument, 5 provided
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface(wcl::ContactSurface&&)
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate expects 1 argument, 5 provided
src/CMakeFiles/wcl.dir/build.make:65: recipe for target 'src/CMakeFiles/wcl.dir/ContactSurface.cpp.o' failed
make[2]: *** [src/CMakeFiles/wcl.dir/ContactSurface.cpp.o] Error 1
make[2]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
CMakeFiles/Makefile2:1300: recipe for target 'src/CMakeFiles/wcl.dir/all' failed
make[1]: *** [src/CMakeFiles/wcl.dir/all] Error 2
make[1]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp: In function ‘wcl::ContactSurface wcl::rectangularSurface(double, double, const Vector3d&, const Matrix3d&, double, unsigned int)’:
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:34:54: error: could not convert ‘{position, rotation, p, mu, nrGenerators}’ from ‘<brace-enclosed initializer list>’ to ‘wcl::ContactSurface’
return { position, rotation, p, mu, nrGenerators };
^
src/CMakeFiles/wcl.dir/build.make:65: recipe for target 'src/CMakeFiles/wcl.dir/ContactSurface.cpp.o' failed
make[2]: *** [src/CMakeFiles/wcl.dir/ContactSurface.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
CMakeFiles/Makefile2:1300: recipe for target 'src/CMakeFiles/wcl.dir/all' failed
make[1]: *** [src/CMakeFiles/wcl.dir/all] Error 2
make[1]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2 |
Ok, it is due to the default initialization of the ContactSurface. |
GCC 5.4 is quite old, this behavior is solved from GCC 5.5 actually. wcl::ContactSurface rectangularSurface(.....)
{
std::vector<Eigen::Vector3d> p;
// all the emplace_back
#if defined(__GNUC__) && (__GNUC___ <= 5 && __GNUC_MINOR__ <= 4)
wcl::ContactSurface cs;
cs.position = position;
cs.rotation = rotation;
cs.points = std::move(p);
cs.mu = mu;
cs.nrGenerators = nrGenerators;
return cs;
#else
return { p, 0.2, 10 };
#endif
} If it works, i will patch. |
Good! It works on my side too, excellent! |
Hi Vincent!
I met the following problem during compilation:
Could you suggest a fix please?
Best,
Yuquan
The text was updated successfully, but these errors were encountered: