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. error: multiple definition of `decrease_seq(int, QString)'
Forum Updated to NodeBB v4.3 + New Features

error: multiple definition of `decrease_seq(int, QString)'

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 519 Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 7 Sept 2018, 18:20 last edited by A Former User 9 Jul 2018, 18:31
    #1

    I'm trying to make header file conrain all the common functions in my application
    when i include once it goes ok but when i include it in two source files it give me multiple definition error

    0_1536344411016_d295e513-e0aa-4012-99bf-943611bb6d33-image.png

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 7 Sept 2018, 18:25 last edited by
      #2

      You'll have to give us a bit more context. What file is it in? do you have declaration/implementation?

      Code Screenshots

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      ? 1 Reply Last reply 7 Sept 2018, 18:29
      2
      • V VRonin
        7 Sept 2018, 18:25

        You'll have to give us a bit more context. What file is it in? do you have declaration/implementation?

        Code Screenshots

        ? Offline
        ? Offline
        A Former User
        wrote on 7 Sept 2018, 18:29 last edited by
        #3

        @VRonin I'm trying to make header file conrain all the common functions in my application
        when i include once it goes ok but when i include it in two source files it give me multiple definition error

        M 1 Reply Last reply 7 Sept 2018, 18:33
        0
        • ? A Former User
          7 Sept 2018, 18:29

          @VRonin I'm trying to make header file conrain all the common functions in my application
          when i include once it goes ok but when i include it in two source files it give me multiple definition error

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 7 Sept 2018, 18:33 last edited by
          #4

          @davidlabib
          Hi
          It seems you have the full function in the HEADER (.h) file ?
          You should have like
          in .h

          void somefunc( int param ); // JUST the header of the function.

          and in .cpp
          void somefunc( int param ) {
          ..code..
          }

          1 Reply Last reply
          3

          1/4

          7 Sept 2018, 18:20

          • Login

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