This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]