7 Replies - 1920 Views - Last Post: 30 October 2009 - 03:16 PM Rate Topic: -----

#1 javalurnin  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 05-October 07

compiler error

Post icon  Posted 30 October 2009 - 02:50 PM

Hi people. Anyone have a clue what the following compiler error means?

Quote

/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o: In function `_start':
/build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld returned 1 exit status


I'm writing a program in C

It's driving me nuts! Please help. :_

Is This A Good Question/Topic? 0
  • +

Replies To: compiler error

#2 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 79
  • View blog
  • Posts: 1,366
  • Joined: 28-March 09

Re: compiler error

Posted 30 October 2009 - 02:57 PM

Nope, no one can help you because we don't know what your code looks like. display your code, what compiler you're using, and your platform(Linux, Windows, Mac... whatever it may be).
Was This Post Helpful? 0
  • +
  • -

#3 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: compiler error

Posted 30 October 2009 - 03:02 PM

It means you left out the main function in your program.
Was This Post Helpful? 0
  • +
  • -

#4 javalurnin  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 05-October 07

Re: compiler error

Posted 30 October 2009 - 03:05 PM

I did write a main function. It's another file, but it's there.
Was This Post Helpful? 0
  • +
  • -

#5 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: compiler error

Posted 30 October 2009 - 03:07 PM

Is it actually being linked to?
Was This Post Helpful? 0
  • +
  • -

#6 javalurnin  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 05-October 07

Re: compiler error

Posted 30 October 2009 - 03:08 PM

Hmm. Would it be advisable to create a makefile instead of compiling each one individually?
Was This Post Helpful? 0
  • +
  • -

#7 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: compiler error

Posted 30 October 2009 - 03:13 PM

Quote

Hmm. Would it be advisable to create a makefile instead of compiling each one individually?
That actually doesn't have anything to do with this issue here. The idea of a makefile is that you can have the computer deal with handling the compiler, etc. So if you have many source files, or many build steps, or complex compiler or link flags, and so on, you would use some kind of build system (like makefiles) to reduce your manual work.

If you compile each one individually, you then have to link them altogether in the end right? So the question is if you are linking the object file that defines the main function.
Was This Post Helpful? 0
  • +
  • -

#8 javalurnin  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 81
  • Joined: 05-October 07

Re: compiler error

Posted 30 October 2009 - 03:16 PM

Oh. duh. So I guess I'm not. How is that done? I'm still kind of new to compiling like this.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1