I just restarted working on a project which has been on hold for a few months. Last time I compiled it it was working just fine, without any error nor warning. Yet when I tried to compile it earlier today I got this warning
attention : ‘template<class _Operation> class std::binder2nd’ is deprecated [-Wdeprecated-declarations]
This warning literally appears hundreds of time when including Eigen/Geometry, which I use all over my project
In file included from [...]/include/Eigen/src/Core/ArrayBase.h:109:0,
from [...]/include/Eigen/Core:350,
from [...]/include/Eigen/Geometry:4,
from [...]/include/[myproject]/types.hh:8,
from [...]/include/[myproject]/voronoi.hh:8
Since then I haven't updated Eigen (is used 3.2.4 which is still the last update today). However, since last time I compiled it, GCC has been updated to 5.1.0 (I'm using archlinux)
Question:
- Is there an issue with gcc 5.1.0 telling me std::binder2nd is deprecated
- Should Eigen be updated ?
- How can I silent those specific warning without loosing the verbosity of my build ?
ANSWER
I appreas that std::bind2nd
is really deprecated and that a commit has been done to solve that in Eigen. This commit is however not yet merged with the master branch :/ (and doesn't solve the issue as some std::bind2nd
are still present in Eigen's code)
Bottom line is: Eigen's last stable version is deprecated
std::bind
instead ofstd::bind2nd
(or its sisterstd::bind1st
).std::bind
is a variadic template. – Kirkcudbrightstd::bind
and didn't even knew aboutstd::bind2nd
. However, the issue here is happening in Eigen which I obviously havent written myself – Darastd::bind
is the recommended function to be used. My comment was intended to help those who maybe did not know aboutstd::bind
but I expressed myself a bit clumsily... – Kirkcudbright-Wdeprecated-declarations
flag. Thus to (temporarily) get rid of these warnings, compile with the-Wno-deprecated-declarations
flag. – Selig-isystem
instead of-I
flag to gcc (for cmake it isinclude_directories(SYSTEM ...)
). This way warnings originated from Eigen includes will not be shown. – Selig