Unsolved Strange Multiple Definition Errors
-
I'm getting a set of strange multiple definition errors moving my project into QtCreator. The short of it is it complains about multiple definitions of a function and then points back to a different function or it points to the object file of the function. Or it will point to the boost library and I'm not sure why.
Here is a sample error
/home/blah/Documents/HS/MP/HP/OSM/org/src/common/op/Config.cc:6: error: multiple definition of `Configuration::type_of_cross_over()'
first defined here /home/blah/Documents/HS/MP/HP/OSM/org/src/common/op/Config.cc:6:
/home/blah/Documents/HS/MP/HP/build-OSM-Desktop-Debug/Config.o:-1: In function `Configuration::nb_offsprings_of_cross_over()':
Here is Config. cc
https://pastebin.com/QJqtDzfn
Here is Config.h
https://pastebin.com/hW9j5qrQ
Here is an error pointing to the boost library
/usr/include/boost/math/tools/detail/rational_horner3_17.hpp:1031: error: multiple definition of `CMAES::CMAES(BaseOptimizationProblem*, std::string const&)'
/usr/include/boost/math/tools/detail/rational_horner3_17.hpp:1031: first defined here
/home/blah/Documents/HS/MercurialProjects/HP/build-OSM-Desktop-Debug/CMAES.o:-1: In function `CMAES::~CMAES()':
Here is the horner file from Boost
https://pastebin.com/tcTrDuqd
Here is CMAES.cc
https://pastebin.com/6eMKvLkY
Here is CMAES.h
https://pastebin.com/7M03CEg4
-
This error clearly indicates that same file is compiled twice in your build. I suggest you to look what are different places this file config.cc is included in your build.