Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 509229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:59:21+00:00 2026-05-13T06:59:21+00:00

I got this error message: multiple definition of `GamepadControll::GamepadControll()’ After being frustrated for hours

  • 0

I got this error message:

multiple definition of `GamepadControll::GamepadControll()’

After being frustrated for hours I reduced the code to:

GamepadControll.h:

#ifndef GAMEPADCONTROLL_H_
#define GAMEPADCONTROLL_H_

#include <iostream>

class GamepadControll {
public:
    GamepadControll();
    virtual ~GamepadControll();
};

#endif /* GAMEPADCONTROLL_H_ */

GamepadControl.cpp:

#include "GamepadControll.h"

GamepadControll::GamepadControll() {
    std::cout << "Hello, I work!" << std::endl;
}

GamepadControll::~GamepadControll() {
    // TODO Auto-generated destructor stub
}

But I just get this error message!

//Edit:
Main isn’t defined.. Can’t I run only a class without mainfiles like in java? Here is the whole eclipse Project: http:/ul.to/m37d2z

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:59:21+00:00Added an answer on May 13, 2026 at 6:59 am

    Most mulitply-defined-symbol error situations tend to be caused by including code into two different compilation units.

    Are you sure that you’re not including GamepadControl.cpp into one of your other source files?

    For example, with both your files and a main.cpp holding:

    #include "GamepadControll.h"
    int main (void) { return 0; }
    

    I get no errors with g++ main.cpp GamepadControll.cpp. If I change that first line to:

    #include "GamepadControll.cpp"
    

    and compile with the same command, I get:

    /tmp/ccbu52oq.o: In function `GamepadControll::GamepadControll()':
    GamepadControll.cpp:(.text+0x0): multiple definition of
        `GamepadControll::GamepadControll()'
    

    The only other possibility I can think of is if you’re explicitly including the code file twice. Using the error-free version of main.cpp above, I still get the error when I use:

    g++ main.cpp GamepadControll.cpp GamepadControll.cpp
    

    If it’s neither of those two cases, your best bet is to provide the full details of your situation. That means every source file (including the main one), the compile and link commands you’re using, and the environment (e.g., gcc3 under Linux, Code::Blocks on Windows).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 248k
  • Answers 248k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Changing your sub to use print and purge instead of… May 13, 2026 at 8:53 am
  • Editorial Team
    Editorial Team added an answer There are some other timeout values that will affect session… May 13, 2026 at 8:53 am
  • Editorial Team
    Editorial Team added an answer I see no side-effect. The lock is guaranteed to be… May 13, 2026 at 8:53 am

Related Questions

I've had this intermittent issue when using asp.net. My site is dynamically compiled. Sometimes
i've got this tables in my database. alt text http://img166.imageshack.us/img166/3133/testdbschemafy5.png With Entity Framework i
In SQL Server 2005 I just struck the infamous error message: Introducing FOREIGN KEY
I have tried to perform update on table which was trigger by update on
Just going through the sample Scala code on Scala website, but encountered an annoying

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.