如何调试此错误? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o [英] how to debug this error? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o
问题描述
我似乎无法弄清楚这个错误的根源以及我如何能够修复它 - 在旧版操作系统上编译的程序
不再使用升级版本进行编译。
我能想到的相关错误如下:
gcc -I。 。-g -O2 -I -c doconfig.c
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib /crt1.o:在函数中
`_start'':
(.text + 0x18):对'main'的未定义引用'
谢谢,
Turgut
durduran @
sas
。 upenn。 edu
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写道:
Durduran wrote:
我不能似乎弄清楚了这个错误的起源以及我怎么可以去修改它的
- 在旧版操作系统上编译的程序
不再编译升级后的版本。
我能想到的相关错误如下:
gcc -I .. -g -O2 -I - c doconfig.c
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:在功能中
`_start'':
(.text + 0x18):对'main'的未定义引用'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function
`_start'':
(.text+0x18): undefined reference to `main''
这使你的命令似乎不太可能像你放入的那样你的
发布。
你给出的命令行包括-c编译的选项但不是
链接,但这是链接器错误。
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写道:
Mark Bluemel wrote:
Durduran写道:
Durduran wrote:
>我似乎无法弄清楚这个错误的根源以及我如何能够去修复它 - 在旧版操作系统上编译的程序不再使用升级后的
版本进行编译。
我能想到的相关错误如下:
gcc -I .. -g -O2 -I -c doconfig.c
>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:
函数`_start'':
(。text + 0x18):未定义引用`main''
>/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程序启动
|在程序启动时调用的函数名为* main *。
显然编译的源文件未能提供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().
这使得你的命令似乎不太可能像你在你的帖子中输入的那样。
您提供的命令行包括-c和-c。编译的选项
但不是链接,但这是一个链接器错误。
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.
偏离主题:我可以想象-I选项吃了那个。但我是
没有gcc专家。尽管如此,请相信我:
非常偏离主题:我猜想有一个shell扩展的
"
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}"在-I之间和-c。
Ralf
{UNDEFINED_SHELL_VARIABLE}" between "-I" and "-c".
Ralf
这篇关于如何调试此错误? /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!