Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Strange Multiple Definition Errors
Qt 6.11 is out! See what's new in the release blog

Strange Multiple Definition Errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 761 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    A123
    wrote on last edited by A123
    #1

    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
    
    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved