Opened 13 years ago
Closed 13 years ago
#3501 closed Bugs (fixed)
Reusing concepts from different compile units yields multiple defined symbols
Reported by: | Owned by: | Gunter | |
---|---|---|---|
Milestone: | Boost 1.41.0 | Component: | uBLAS |
Version: | Boost 1.39.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Currently I use the ublas concepts defined in ublas/detail/concepts.hpp to derive concepts based on ublas concepts such as
template<class X> struct Vector : boost::numeric::ublas::VectorConcept<X> {};
In my unit test project I have different compile units that use BOOST_CONCEPT_ASSERT to assure Vector concept compliance. This yields multiple defined symbols for the following methods (and full specialized versions):
ublas/detail/concepts.hpp: void concept_checks(); template<class T> ZeroElement(T); template<class T> OneElement(T);
inlining those solves the problem (for me). I'm compiling on MSVC9.0. Current trunk seems to have this methods still not-inlined.
Change History (11)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Status: | new → assigned |
---|
@Christoph: please check if the committed version fixes your problem. If not, please provide a small example to reproduce the problem.
comment:3 by , 13 years ago
@Gunter Committed version fixes my problem. I did not test on a fresh trunk checkout. All I did was replacing concepts.hpp of 1.39.0 by current head revision. Thanks for your help.
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:5 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Hi Gunter,
I fear we need to reopen the bug. In Debug the same linker error as reported occurs because BOOST_UBLAS_INLINE is not defined to inline at all.
Therefore I suggest attributing the free functions with inline explicitely, unless someone knows a better solution.
best regards, Christoph
comment:6 by , 13 years ago
In config.hpp you can find the lines
#ifdef NDEBUG #ifndef BOOST_UBLAS_INLINE #define BOOST_UBLAS_INLINE inline #endif ...
This means that inline is disabled in debug builds in order to be able to follow the execution path. Explicitely defining
#define BOOST_UBLAS_INLINE inline
before including any uBLAS header should solve the problem.
comment:7 by , 13 years ago
It would solve the problem indeed.
I wonder, however, if requiring the user to do the bugfixing for a third-party library in his code is the best way to handle this.
comment:8 by , 13 years ago
comment:9 by , 13 years ago
comment:11 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
(In [56578]) see #3501: Reusing concepts from different compile units yields multiple defined symbols