I am using dlib 18.8 and boost 1.55 together in a project,
for some reason today I updated boost library to 1.56,
and there were some error messages on compile time,
it's about the redefinition of boost::noncopyable_::noncopyable.
Although I noticed there is a macro called
"BOOST_NONCOPYABLE_HPP_INCLUDED" in this header file
which could be used to prevent this redefinition, but I have no
idea why not just use a dlib namespace ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, that's a problem with the newer boost and it will be fixed in the
next dlib release. But to fix it, you can do just what you said, put
noncopyable into the dlib namespace and remove the references to boost. So
if you changed the file to this it will work fine:
I discovered this same problem. But it seems to me that you just need to fix the incorrect boost protection macro name. There are currently two protections:
Yeah, that would fix it as well. However, changing it to not mention boost
at all will prevent this problem from happening in the future when boost
changes these preprocessor names.
Cheers,
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I experienced this issue as well in dlib 18.8 when I moved from boost 1.55 to boost 1.57. Changing to dlib 18.11 resolved it, but there is a similar issue in dlib/enable_if.h.
Changing the preprocessor definition BOOST_UTILITY_ENABLE_IF_HPP to BOOST_CORE_ENABLE_IF_HPP as it is now in boost/core/enable_if.h resolves these compiler errors.
I bet would be be quite a chore to keep up with every boost namespace and preprocessor definition change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, thanks for pointing this out as well. I'm just going to change these
so the declarations are in the dlib namespace rather than reuse the boost
files so this is not a problem in the future.
Cheers,
Davis
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am using dlib 18.8 and boost 1.55 together in a project,
for some reason today I updated boost library to 1.56,
and there were some error messages on compile time,
it's about the redefinition of boost::noncopyable_::noncopyable.
Although I noticed there is a macro called
"BOOST_NONCOPYABLE_HPP_INCLUDED" in this header file
which could be used to prevent this redefinition, but I have no
idea why not just use a dlib namespace ?
Yeah, that's a problem with the newer boost and it will be fixed in the
next dlib release. But to fix it, you can do just what you said, put
noncopyable into the dlib namespace and remove the references to boost. So
if you changed the file to this it will work fine:
Last edit: Davis 2014-11-03
I discovered this same problem. But it seems to me that you just need to fix the incorrect boost protection macro name. There are currently two protections:
The second one does not match the name used in boost, it should be BOOST_NONCOPYABLE_HPP. If you change this, then it will only compile one copy.
Yeah, that would fix it as well. However, changing it to not mention boost
at all will prevent this problem from happening in the future when boost
changes these preprocessor names.
Cheers,
Davis
I experienced this issue as well in dlib 18.8 when I moved from boost 1.55 to boost 1.57. Changing to dlib 18.11 resolved it, but there is a similar issue in
dlib/enable_if.h
.Changing the preprocessor definition
BOOST_UTILITY_ENABLE_IF_HPP
toBOOST_CORE_ENABLE_IF_HPP
as it is now inboost/core/enable_if.h
resolves these compiler errors.I bet would be be quite a chore to keep up with every boost namespace and preprocessor definition change.
Yeah, thanks for pointing this out as well. I'm just going to change these
so the declarations are in the dlib namespace rather than reuse the boost
files so this is not a problem in the future.
Cheers,
Davis