Thread: dev c++......WHATS THE ERROR..PLZ HELP

  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    3

    Unhappy dev c++......WHATS THE ERROR..PLZ HELP

    Code:
    #include <iostream>
      #include <stdlib.h>
      #include <iomanip>
      using namespace std;
      int main()
      {
          int n,i,j,a[10],b[10];
          cin>>n;
          for(i=0;i<n;i++)
          cin>>a[i];
          for(j=0;j<n;j++)
          cin>>b[j];
          cin.ignore(256, '\n');
          cin.get();
          return 0;
      }
    ERRORS:MULTILE DEFINITION OF MAIN
    FIRST DEFINED HERE
    ld returned 1 exit status
    [Build Error] [niki.exe] Error 1

    PLZZZZZZ HELP.............

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    3
    plzzzzzzzz help!!!!!!!!

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    27
    I can compile your code w/o error...

  4. #4
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    This is not a compiler error. It is a programmer error in setting up the project. The error message is from the linker, not the compiler.

    You have multiple source files in your project. One of those other files has also defined (i.e. implemented) a main() function. Remove other source files (or object files, if you manually added them) from your project.

    And, in forums like thine one, you need to learn patience because people respond when they get around to it. Bumping a thread after 12 minutes with a "plzzz help" is not patience.

  5. #5
    Registered User jeffcobb's Avatar
    Join Date
    Dec 2009
    Location
    Henderson, NV
    Posts
    875
    Quote Originally Posted by grumpy View Post
    This is not a compiler error. It is a programmer error in setting up the project.
    And, in forums like thine one, you need to learn patience because people respond when they get around to it. Bumping a thread after 12 minutes with a "plzzz help" is not patience.
    Seriously. 12 minutes was too long to wait for an answer? Wow. In any event it seems like there are more instances of main() defined; I would look there first.

    Peace and patience...
    C/C++ Environment: GNU CC/Emacs
    Make system: CMake
    Debuggers: Valgrind/GDB

  6. #6
    Registered User
    Join Date
    Sep 2009
    Location
    Pune, India
    Posts
    4
    Quote Originally Posted by nikita View Post
    Code:
    #include <iostream>
      #include <stdlib.h>
      #include <iomanip>
      using namespace std;
      int main()
      {
          int n,i,j,a[10],b[10];
          cin>>n;
          for(i=0;i<n;i++)
          cin>>a[i];
          for(j=0;j<n;j++)
          cin>>b[j];
          cin.ignore(256, '\n');
          cin.get();
          return 0;
      }
    ERRORS:MULTILE DEFINITION OF MAIN
    FIRST DEFINED HERE
    ld returned 1 exit status
    [Build Error] [niki.exe] Error 1

    PLZZZZZZ HELP.............
    The code is correct and executes properly. No errors are reported as suggested by you

  7. #7
    Registered User
    Join Date
    Dec 2009
    Posts
    3

    Thankyou

    thanx everybody.......nd sorry for losing patience......
    i m new here nd i m learning dev c++ all by myself so i was irritated last day but i wont do it again......

  8. #8
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    If you ever think of posting here again, read this first.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Resources with Dev C++ Problem (many simple problems)
    By Zeusbwr in forum Windows Programming
    Replies: 4
    Last Post: 04-06-2005, 11:08 PM
  2. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  3. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  4. openGL programming - From MSVC++ to Dev C++
    By WDT in forum Game Programming
    Replies: 3
    Last Post: 03-08-2004, 08:47 PM
  5. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 09:40 PM