Subject: [Boost-bugs] [Boost C++ Libraries] #6010: Linkage problems in assignment.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-11 18:03:01
#6010: Linkage problems in assignment.hpp
---------------------------------+------------------------------------------
Reporter: nasos_i@⦠| Owner: guwi17
Type: Bugs | Status: new
Milestone: Boost 1.48.0 | Component: uBLAS
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
---------------------------------+------------------------------------------
Original report in uBlas mailing list:
{{{
Hi,
I started using ublas's "<<=" assignment, and I'm starting to regret it.
First symptom: if I compile with the gcc flag -Wmissing-prototypes I get
the following warnings:
In file included from
/Users/devernay/Development/stereocam/surf/CameraMatrixP.hpp:16,
from
/Users/devernay/Development/stereocam/surf/TriFocalTensor/Trifocaltensor.hpp:18,
from
/Users/devernay/Development/stereocam/surf/TriFocalTensor/TrifocaltensorBundleAdjustement.cpp:20:
/opt/local/include/boost/numeric/ublas/assignment.hpp:454: warning: no
previous prototype for 'boost::numeric::ublas::begin1_manip
boost::numeric::ublas::begin1()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:498: warning: no
previous prototype for 'boost::numeric::ublas::begin2_manip
boost::numeric::ublas::begin2()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:543: warning: no
previous prototype for 'boost::numeric::ublas::next_row_manip
boost::numeric::ublas::next_row()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:587: warning: no
previous prototype for 'boost::numeric::ublas::next_column_manip
boost::numeric::ublas::next_column()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:888: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_row_policy<boost::numeric::ublas::traverse_policy::wrap>
boost::numeric::ublas::traverse_policy::by_row()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:892: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_row_policy<boost::numeric::ublas::traverse_policy::wrap>
boost::numeric::ublas::traverse_policy::by_row_wrap()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:896: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_row_policy<boost::numeric::ublas::traverse_policy::no_wrap>
boost::numeric::ublas::traverse_policy::by_row_no_wrap()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:900: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_column_policy<boost::numeric::ublas::traverse_policy::wrap>
boost::numeric::ublas::traverse_policy::by_column()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:904: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_column_policy<boost::numeric::ublas::traverse_policy::wrap>
boost::numeric::ublas::traverse_policy::by_column_wrap()'
/opt/local/include/boost/numeric/ublas/assignment.hpp:908: warning: no
previous prototype for
'boost::numeric::ublas::traverse_policy::by_column_policy<boost::numeric::ublas::traverse_policy::no_wrap>
boost::numeric::ublas::traverse_policy::by_column_no_wrap()'
But the second symptom is more critical: Since these symbols are defined
in EVERY file that includes them, I cannot link anything and I get tons of
"multiply defined symbols".
Looking at the file, I found out that:
- begin1(), begin2(), and a few others are not inlined, but conditionally
inlined, using BOOST_UBLAS_INLINE (which inlines only if NDEBUG is
defined), and are NOT members of classes, thus the multiply defined
symbols...
- boost::numeric::ublas::traverse_policy::by_row() and other are just
defined, and not inlined.
So, really, what's the solution?
Here's what I think:
BOOST_UBLAS_INLINE should ONY be used for class members, NOT for
functions, which should be simply declared "inline".
by_row() and friends should either be inlined or declared as static
members of an empty class.
I tried putting the magic word "inline" in front of each of these, and it
works.
fred
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6010> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC