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

  • SEARCH
  • Home
  • 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 8684491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:19:24+00:00 2026-06-12T22:19:24+00:00

In the journey to learning C++ I’m learning through the C++ Manual that’s on

  • 0

In the journey to learning C++ I’m learning through the C++ Manual that’s on the actual website. I’m using DevC++ and have hit a problem, not knowing whether its the compiler error or not.

I was going through this code bit by bit typing it in myself, as I feel it’s more productive, and adding my own stuff that I’ve learnt from the examples, then I got to initialising variables. This is the code that is in the C++ manual

#include <iostream>

using namespace std;
int main ()
{
    int a=5;     // initial value = 5
    int b(2);    // initial value = 2
    int result;  // initial value undetermined

    a = a + 3;
    result = a - b;
    cout << result;

    return 0;
}

This is popping up a compiler error saying "Multiple definitions of "Main""
Now this is on the actual C++ page so I’m guessing it’s a compiler error.

Could someone please point me in the right direction as to why this is happening and what is the cause for this error?

  • 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-06-12T22:19:25+00:00Added an answer on June 12, 2026 at 10:19 pm

    Multiple definitions of “main” suggests that you have another definition of main. Perhaps in another .c or .cpp file in your project. You can only have one function with the same name and signature (parameter types). Also, main is very special so you can only have one main function that can be used as the entry point (has either no parameters, one int, or an int and a char**) in your project.

    P.S. Technically this is a linker error. It’s a subtle difference, but basically it’s complaining that the linker can’t determine which function should be the entry point, because there’s more than one definition with the same name.

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

Sidebar

Related Questions

On my journey to learning F#, I've run into a problem I cant solve.
Is there anyway, using google analytics, to track a user's journey/selections through a long
I am about to embark on a jquery journey I have not ever done.
I have a IQueryable<Journey> that i collect from my entity model. I want to
I have never written any IPC C++ on Linux before. My problem is that
I've recently begun my journey of learning CSS, and have been studying Gmail's design,
I am just beginning my journey into web development and I have a very
As I am going through my journey by adopting the Ruby language, I spend
in my journey of learning hibernate i came across an article on hibernate site
Just beginning my journey in ASP.Net MVC and I have a query about something

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.