[Boost-bugs] [Boost C++ Libraries] #10487: Multiple definitions of bool boost::numeric::odeint by multiple #include

Subject: [Boost-bugs] [Boost C++ Libraries] #10487: Multiple definitions of bool boost::numeric::odeint by multiple #include
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-09-10 11:43:13


#10487: Multiple definitions of bool boost::numeric::odeint by multiple #include
-----------------------------------+---------------------
 Reporter: guillaume.jacquenot@… | Owner: karsten
     Type: Bugs | Status: new
Milestone: Boost 1.57.0 | Component: odeint
  Version: Boost 1.56.0 | Severity: Problem
 Keywords: |
-----------------------------------+---------------------
 Dear all,

 I encountered a linker problem within the odeint code of library
 boost::numeric with boost 1.56 on Debian 32 bit with gcc 4.7. There (and I
 guess on many other compilers) will be multiple definitions of functions.
 The error is known not to occur with version 1.55.0.

 When using several inclusions of the following files in various code file

 #include <boost/numeric/odeint/stepper/euler.hpp>
 #include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
 #include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp>

 the linker produces an error of multiple definitions for
 boost::numeric::odeint::detail.

 This linker problem will not occur if only one .cpp file #includes this
 file.

 Possible explanation taken from bug number 7678:

 Seemingly compiling each compile unit like foo.cpp, bar.cpp, etc. produces
 a definition into its individual .obj-file, namely foo.obj, bar.obj, etc..
 Later the linker can not resolve which of the multiple definitions of
 "belongs", the one in foo.obj or the one in bar.obj, to take when binding
 the executable.


 CMake log:

 Linking CXX executable run_all_tests
 XXXXXXXXXXX/libXXXXXXXXXXX_static.a(FILE_YYYYYYYYYYYYY.cpp.o):(.bss+0x0):
 multiple definition of `boost::numeric::odeint::detail::_2'
 src/FILE_ZZZZZZZZZZZ.cpp.o:(.bss+0x10): first defined here
 XXXXXXXXXXX/libXXXXXXXXXXX_static.a(FILE_YYYYYYYYYYYYY.cpp.o):(.bss+0x1):
 multiple definition of `boost::numeric::odeint::detail::_1'
 src/FILE_ZZZZZZZZZZZ.cpp.o:(.bss+0x11): first defined here
 collect2: error: ld returned 1 exit status


 The bug is similar to the one described here

 https://svn.boost.org/trac/boost/ticket/7678


 Guillaume Jacquenot

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10487>
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:16 UTC