Undefined Reference to Main

Discussion in 'C Programming' started by Raj Pashwar, Jun 12, 2012.

  1. Raj Pashwar

    Raj Pashwar Guest

    Has anyone ever encountered this sort of bug??
    does anyone know the resolution...

    -------------------------------

    $ make
    g++ -O -o Av_utils Av_utils.cpp -L/root/fakespace/lib/Linux_32_Release
    -L/root/fakespace/glut_libs/glut-3.7/Linux_32/Mesa -lmui -lglut -lGLU
    -lGL -L/usr/X11R6/lib -lXi -lXmu -lX11 -lXext -lm

    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function
    `_start':

    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18):
    undefined reference to `main'
    collect2: ld returned 1 exit status
    make: *** [Av_utils] Error 1

    -----------------------------

    thanks much!
     
    Raj Pashwar, Jun 12, 2012
    #1
    1. Advertising

  2. Raj Pashwar

    Joe Pfeiffer Guest

    Raj Pashwar <> writes:

    > Has anyone ever encountered this sort of bug??
    > does anyone know the resolution...
    >
    > -------------------------------
    >
    > $ make
    > g++ -O -o Av_utils Av_utils.cpp -L/root/fakespace/lib/Linux_32_Release
    > -L/root/fakespace/glut_libs/glut-3.7/Linux_32/Mesa -lmui -lglut -lGLU
    > -lGL -L/usr/X11R6/lib -lXi -lXmu -lX11 -lXext -lm
    >
    > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function
    > `_start':
    >
    > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18):
    > undefined reference to `main'
    > collect2: ld returned 1 exit status
    > make: *** [Av_utils] Error 1
    >
    > -----------------------------
    >
    > thanks much!


    Only when I in fact didn't have a main() in my program.
     
    Joe Pfeiffer, Jun 12, 2012
    #2
    1. Advertising

  3. Raj Pashwar <> writes:

    <snip>
    > $ make
    > g++ -O -o Av_utils Av_utils.cpp -L/root/fakespace/lib/Linux_32_Release

    ^^ ^^^^
    comp.lang.c++ is a better group for C++ questions.

    <snip>
    --
    Ben.
     
    Ben Bacarisse, Jun 12, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John M
    Replies:
    1
    Views:
    1,310
    Kumar Reddi
    May 29, 2005
  2. blueblueblue2005
    Replies:
    3
    Views:
    615
    Bob Hairgrove
    Jun 25, 2005
  3. owolablo

    undefined reference to `main'

    owolablo, Oct 6, 2006, in forum: C++
    Replies:
    8
    Views:
    537
    Steve Pope
    Oct 6, 2006
  4. fdm
    Replies:
    1
    Views:
    2,455
    Maxim Yegorushkin
    Oct 4, 2009
  5. suresh
    Replies:
    16
    Views:
    3,432
    suresh
    Sep 8, 2010
Loading...

Share This Page