dealer: dealer.o readline.o car.o
gcc -o dealer readline.o car.o
dealer.o: dealer.c car.h readline.h
gcc -c dealer.c
readline.o: readline.c car.h readline.h
gcc -c readline.c
car.o: car.c car.h readline.h
gcc -c car.c
make dealer
gcc -c dealer.c
gcc -c readline.c
gcc -c car.c
gcc -o dealer readline.o car.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [dealer] Error 1
I keep getting the error above. My dealer.c does indeed contain 'main'.
Does anybody have an idea on whats going on?
your link line:
gcc -o dealer readline.o car.o
doesn't contain dealer.o, which explains why main is missing. Should be:
gcc -o dealer dealer.o readline.o car.o
(there's no automatic/guessed relation between the name of the final executable indicated by -o dealer and the object file dealer.o)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With