Thread: college kid in need of help...PLEASE :(

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    4

    college kid in need of help...PLEASE :(

    new college student in need of help ...doing some programming on my own and just starting to learn.
    I am really new to the programming world.
    Forgive me for my ignorance
    I have DEV-C++ compiler...I was following a tutorial and i'm having some problems compiling and running a program can you help me .
    when i hit compile and run these three message come up and some one explain and help me correct my problem.

    avergae.cpp C:\Dev-Cpp\avergae.o(.text+0x50) multiple definition of `main'

    averge.cpp C:\Dev-Cpp\averge.o(.text+0x6) first defined here

    C:\Dev-Cpp\Makefile.win[Build Error] ["hello] Error 1


    those are the message that come up with no line number and here is my code

    Code:
    #include<iostream>
    using namespace std;
    
    int main(void)
    {
    
        double dnumber1 = 0.0;
        double dnumber2 = 0.0;
        double dnumber3 = 0.0;
        double daverage = 0.0;
    
        cout << "please enter  3 numbers: " << endl;
        cin >> dnumber1;
        cin >> dnumber2;
        cin >> dnumber3;
    
        daverage = (dnumber1 + dnumber2 + dnumber3 ) / 3;
    
        cout << "the average of the numbers are: " << daverage << endl << endl;
    
        system("pause");
        return 0;
    }



    am i doing something wrong can someone help me ...

    my email is <<snipped>> thanks everyone in advance for help
    Last edited by Salem; 08-26-2007 at 10:58 AM. Reason: Removed email address

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    It looks like Dev-C++ thinks you have two files in your project, one called avergae.cpp and one called averge.cpp. You should only have one file. Remove the file you don't want to use from the project and try building again.

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    avergae.cpp C:\Dev-Cpp\avergae.o(.text+0x50) multiple definition of `main'
    averge.cpp C:\Dev-Cpp\averge.o(.text+0x6) first defined here

    isn't it obvious? did you read this?

    if it says to you multiple definition of `main', and this is in the form of a compiling ERROR, then what makes you think this isn't another hint; first defined here... why didn't you assume that it means you need to get rid of one?


    you need to learn how to solve problems on your own just as much as the language, it's important, trust me on that.

  4. #4
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,688
    Thats a bit harsh... but fair.

    Most problems can be put right by reading and understanding the compiler messages... but to a new starter in the language the error messages can seem cryptic and confusing... it never hurts to ask for help... you learn from people with more knowledge then you gain some yourself.. building on what you have learnt... in programming making errors is one of if not the most common thing we do
    Double Helix STL

  5. #5
    Registered User
    Join Date
    Aug 2007
    Posts
    4
    thanks everyone but right after i posted the question i foudn the answer...thank you all for ya comments.

    I will proudly ask for your help in the future.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Should I go to a state college and be 20k in debt, or a private college and be 90k in
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-10-2003, 08:22 PM
  2. University versus college, which should I do?
    By Terrance11 in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 07-02-2003, 11:19 PM
  3. Which college should I go to?
    By Terrance in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 05-13-2003, 10:06 PM
  4. College or No College :: Future
    By kuphryn in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 09-25-2002, 03:48 PM
  5. Replies: 2
    Last Post: 11-29-2001, 02:07 AM