how to debug this error? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o

Discussion in 'C Programming' started by Durduran, Jul 26, 2007.

  1. Durduran

    Durduran Guest

    I can't seem to figure out the origin of this error and how I could go
    about fixing it -- the program that compiled on an older version of the OS
    no longer compiles with the upgraded version.

    The relevant error I can think is the following:

    gcc -I.. -g -O2 -I -c doconfig.c
    /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function
    `_start':
    (.text+0x18): undefined reference to `main'


    Thanks,

    Turgut
    durduran@
    s a s
    . upenn . edu
    Durduran, Jul 26, 2007
    #1
    1. Advertising

  2. Durduran

    Mark Bluemel Guest

    Durduran wrote:
    > I can't seem to figure out the origin of this error and how I could go
    > about fixing it -- the program that compiled on an older version of the OS
    > no longer compiles with the upgraded version.
    >
    > The relevant error I can think is the following:
    >
    > gcc -I.. -g -O2 -I -c doconfig.c


    Are you sure this is the command you typed?

    > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function
    > `_start':
    > (.text+0x18): undefined reference to `main'


    This makes it seem unlikely that your command was as you've put in your
    posting.

    The command line you gave included the "-c" option to compile but not
    link, but this is a linker error.
    Mark Bluemel, Jul 26, 2007
    #2
    1. Advertising

  3. Mark Bluemel wrote:
    > Durduran wrote:
    >> I can't seem to figure out the origin of this error and how I
    >> could go about fixing it -- the program that compiled on an
    >> older version of the OS no longer compiles with the upgraded
    >> version.
    >>
    >> The relevant error I can think is the following:
    >>
    >> gcc -I.. -g -O2 -I -c doconfig.c

    >
    > Are you sure this is the command you typed?
    >
    >> /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In
    >> function `_start':
    >> (.text+0x18): undefined reference to `main'


    C99:
    | 5.1.2.2.1 Program startup
    | The function called at program startup is named *main*.

    Apparently the source file compiled failed to provide a
    definition of main().

    > This makes it seem unlikely that your command was as you've
    > put in your posting.
    >
    > The command line you gave included the "-c" option to compile
    > but not link, but this is a linker error.


    Off-topic: I could imagine the "-I" option ate that. But I am
    no gcc expert. Trusting me nonetheless:
    Very-off-topic: I would guess that there is a shell-expanded
    "${UNDEFINED_SHELL_VARIABLE}" between "-I" and "-c".

    Ralf
    Ralf Damaschke, Jul 26, 2007
    #3
  4. Durduran

    santosh Guest

    Durduran wrote:

    > I can't seem to figure out the origin of this error and how I could go
    > about fixing it -- the program that compiled on an older version of the OS
    > no longer compiles with the upgraded version.
    >
    > The relevant error I can think is the following:
    >
    > gcc -I.. -g -O2 -I -c doconfig.c
    > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function
    > `_start':
    > (.text+0x18): undefined reference to `main'


    Going by what your excerpt above shows, it seems that your translation unit
    does not have a main function. For hosted programs, a main function is
    required for program startup.
    santosh, Jul 26, 2007
    #4
  5. Durduran

    Durduran Guest

    On 2007-07-26, Mark Bluemel <> wrote:
    > Durduran wrote:
    >> I can't seem to figure out the origin of this error and how I could go
    >> about fixing it -- the program that compiled on an older version of the OS
    >> no longer compiles with the upgraded version.
    >>
    >> The relevant error I can think is the following:
    >>
    >> gcc -I.. -g -O2 -I -c doconfig.c

    >
    > Are you sure this is the command you typed?


    it is a somewhat compilcated MakeFile and I can't yet figure out what
    exactly it did, but that is what was output to screen.
    Durduran, Jul 26, 2007
    #5
  6. Durduran

    Durduran Guest

    On 2007-07-26, Ralf Damaschke <> wrote:
    > C99:
    >| 5.1.2.2.1 Program startup
    >| The function called at program startup is named *main*.
    >
    > Apparently the source file compiled failed to provide a
    > definition of main().


    That is the cause of my inability to debug this because this package works
    on another computer with gcc version 3.3.3 but not this one with gcc
    version 4.1.2 . So my source files are fine, some library or something
    that it is being linked to is not.
    Durduran, Jul 26, 2007
    #6
  7. In article <>,
    Durduran <> wrote:
    >On 2007-07-26, Mark Bluemel <> wrote:
    >> Durduran wrote:
    >>> I can't seem to figure out the origin of this error and how I could go
    >>> about fixing it -- the program that compiled on an older version of the OS
    >>> no longer compiles with the upgraded version.
    >>>
    >>> The relevant error I can think is the following:
    >>>
    >>> gcc -I.. -g -O2 -I -c doconfig.c

    >>
    >> Are you sure this is the command you typed?

    >
    >it is a somewhat compilcated MakeFile and I can't yet figure out what
    >exactly it did, but that is what was output to screen.
    >


    It can't be. You won't get this error from a "-c" compilation.

    It is likely that the Makefile isn't displaying the final "link"
    invocation of gcc (but the error message from it is *is* being
    displayed)
    Kenny McCormack, Jul 26, 2007
    #7
  8. Re: how to debug this error?/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o

    Kenny McCormack wrote:
    >
    > In article <>,
    > Durduran <> wrote:
    > >On 2007-07-26, Mark Bluemel <> wrote:
    > >> Durduran wrote:
    > >>> I can't seem to figure out the origin of this error and how I could go
    > >>> about fixing it -- the program that compiled on an older version of the OS
    > >>> no longer compiles with the upgraded version.
    > >>>
    > >>> The relevant error I can think is the following:
    > >>>
    > >>> gcc -I.. -g -O2 -I -c doconfig.c
    > >>
    > >> Are you sure this is the command you typed?

    > >
    > >it is a somewhat compilcated MakeFile and I can't yet figure out what
    > >exactly it did, but that is what was output to screen.
    > >

    >
    > It can't be. You won't get this error from a "-c" compilation.


    <OT>
    Unless the naked "-I" that preceeds it eats the "-c".
    </OT>

    > It is likely that the Makefile isn't displaying the final "link"
    > invocation of gcc (but the error message from it is *is* being
    > displayed)



    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
    Kenneth Brody, Jul 26, 2007
    #8
  9. Durduran

    Durduran Guest

    Re: how to debug this error? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o

    turns out the problem was a combination of flags in configure.in which was
    somehow messing up if the X headers were installed. I have no idea why but
    it is solved now.
    Durduran, Jul 30, 2007
    #9
  10. Durduran

    santosh Guest

    Re: how to debug this error? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o

    Durduran wrote:

    > turns out the problem was a combination of flags in configure.in which was
    > somehow messing up if the X headers were installed. I have no idea why but
    > it is solved now.


    For those using non-threaded newsreaders, your post is difficult to make
    sense of without context. You should quote relevant portions of the message
    to which you're replying.
    santosh, Jul 30, 2007
    #10
  11. Durduran

    Durduran Guest

    Re: how to debug this error? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o

    On 2007-07-30, santosh <> wrote:
    > Durduran wrote:
    >
    >> turns out the problem was a combination of flags in configure.in which was
    >> somehow messing up if the X headers were installed. I have no idea why but
    >> it is solved now.

    >
    > For those using non-threaded newsreaders, your post is difficult to make
    > sense of without context. You should quote relevant portions of the message
    > to which you're replying.


    I apologize. I was trying to summarize what my conclusion regarding this
    error was and I was not responding a particular post.

    Thanks for all who responded.

    turgut
    Durduran, Jul 30, 2007
    #11
    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. Col
    Replies:
    0
    Views:
    387
  2. TsanChung
    Replies:
    4
    Views:
    1,208
    TsanChung
    Sep 21, 2008
  3. bx

    lib/crt1

    bx, Aug 25, 2011, in forum: C++
    Replies:
    2
    Views:
    312
  4. anne001
    Replies:
    1
    Views:
    402
  5. Roy Stannard

    Ruby 1.8.6 (i486-linux)

    Roy Stannard, May 1, 2008, in forum: Ruby
    Replies:
    5
    Views:
    116
    Roy Stannard
    May 2, 2008
Loading...

Share This Page