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

D

Durduran

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
 
M

Mark Bluemel

Durduran said:
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.
 
R

Ralf Damaschke

Mark said:
Are you sure this is the command you typed?

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
 
S

santosh

Durduran said:
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.
 
D

Durduran

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.
 
D

Durduran

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.
 
K

Kenny McCormack

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)
 
K

Kenneth Brody

Kenny said:
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".
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:[email protected]>
 
D

Durduran

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.
 
S

santosh

Durduran said:
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.
 
D

Durduran

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top