作者sa901119 (ads901119)
看板EE_DSnP
标题[问题] Err msg 'undefined reference to main' in make
时间Wed Mar 18 11:40:52 2009
Sorry I don't know how to install Chinese input method on this machine = =
I failed to make the files of hw1.1.4a, and here's the error message:
g++ -c main.cpp
g++ -o main.o a.o b.o
/usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [hw1.1.4a] Error 1
I saw someone ask the same question before on this board,
but I'm sure that my disk is very empty.
What happened ?
Can anyone give me a hand ? Thanks a lot.
--
http://www.wretch.cc/blog/ads901119
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.252.248
1F:推 timrau:"g++ -o main.o a.o b.o" 03/18 11:46
2F:→ timrau:等於是尝试把a.o, b.o link成执行档main.o 03/18 11:47
3F:→ timrau:那当然找不到main()..... 03/18 11:47
4F:→ sa901119:I got it, thank you so much~~ 03/18 11:50