This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ld: 0711-317 ERROR: Undefined symbol: .main gcc error
- From: John Love-Jensen <eljay at adobe dot com>
- To: <jayashree dot nair at polaris dot co dot in>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Tue, 12 Dec 2006 06:36:03 -0600
- Subject: Re: ld: 0711-317 ERROR: Undefined symbol: .main gcc error
Hi Jayashree,
You are posting in an incorrect forum. This is the GCC help forum, not the
GNU Make help forum.
I do not mention this to chastise, I mention it because it is likely that
you will get better, faster, more accurate answers on a GNU Make help forum
then here.
That being said...
This line is malformed:
OBJ_MAIN_EOD = $( SRC_MAIN_EOD:.c=.o)
You have a space after the open paren.
Also, just as a matter of style, I recommend you using this for your eod
target:
eod: $(OBJ_MAIN_EOD)
$(CC) $(CFLAGS) -o $@ $^ $(INCLUDE) -L. -L$(ORACLE_HOME)/lib32/ $(LIBPATH)
See 'automatic variables' in http://www.gnu.org/software/make/manual/
Also, my personal preference is to have all builds explicit (either ordinary
targets, or pattern rule targets), instead of relying on the implicit %.o :
%.c pattern rule. But that's just me, and I only mention it for your
consideration.
HTH,
--Eljay