Makefile compilation Error -Unable to create executable

Hi ,

While trying to compile a PRO*C code on unix using makefile i get the following errors. i am now working on a 10g migration (from 8i) ...
these makefile perfectly work in previous version.

ld: fatal: file /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.Server-cltxm251/SSD.Server/ssdArther/Arther: unknown file type
ld: fatal: File processing errors. No output written to Arther
*** Error code 1
make: Fatal error: Command failed for target `Arther'

Arther is the executable which must be ultimately created.
What could be the cause of error ?

Below is a code snippet of my makefile

Arther: arther.o strings.o Useful.o
ld -dy $(COMPOBJS) $(LDSTRING) $(LDFLAGS) -o $(PROC_PREFIX)Arther $(PROC_PREFIX)arther.o $(CODEO)strings.o $(CODEO)Us
eful.o $(GETTLV_PREFIX)get_tlv.o $(GETTLV_PREFIX)reschedule_update.o $(GETTLV_PREFIX)put_tlv.o $(GETTLV_PREFIX)complete_updat
e.o $(GETTLV_PREFIX)update.o $(GETTLV_PREFIX)rollback_update.o $(PROLDLIBS) $(RDBMSLIBS) -lbase -lgen $(SYSLIBS)

strings.o: $(CODEC)strings.c $(CODEH)global.h \
$(CODEH)strings.h
$(CC) $(CFLAGS) -g -c $(CODEC)strings.c -o $(CODEO)strings.o

arther.o: $(CODEH)global.h \
$(CODEH)strings.h $(CODEH)global.h $(CODEH)arther.h
$(PROC) $(PROCPLSFLAGS) $(PROFLAGS) iname=$(PROC_PREFIX)arther.pc include=$(CODEH)
$(CC) $(CFLAGS) -g $(PRECOMPPUBLIC) -c $(PROC_PREFIX)arther.c -o $(PROC_PREFIX)arther.o

Useful.o: $(CODEH)global.h \
$(CODEH)strings.h $(CODEH)global.h $(CODEH)Useful.h
$(PROC) $(PROCPLSFLAGS) $(PROFLAGS) iname=$(CODEC)Useful.pc include=$(CODEH)
$(CC) $(CFLAGS) -g $(PRECOMPPUBLIC) -c $(CODEC)Useful.c -o $(CODEO)Useful.o

Also what is the use of these varibles $(COMPOBJS) $(LDSTRING) $(LDFLAGS) ?? should i modify these varibles ??

Any help in this regard is highly appreciated.

Thanks in Advance
Regards,
Siva

Are you producing an application or shared library?

99% of my makefiles have " -o $@ " so the output file is exactly the same as the rule product.

I only use $(LD) to link shared libraries, I use $(CC) or $(CXX) to link applications.

Hi Porter,

i am trying to create an executable named arther (an Applicaton)
i am completely new to makefile's ... So it would be great if u could help me in this regard.

Siva

A makefile rule is as follows

output :  input......
      command to build

Your macro $(PROC_PREFIX) looks wrong as it's not in the rule.

Eg your command says "$(PROC_PREFIX)arther.o" but the rule says "arther.o"

Hi porter,
i had pasted only a portion of my makefile... $(PROC_PREFIX) is defined correctly ... sorry for not mentioning that...

i modified my makefile little bit like,
LDFLAGS=-o
COMPSOBJS32 .
After making the changes , i am getting the errors like,

ld -dy /opt/SUNWspro/prod/lib/crti.o /opt/SUNWspro/prod/lib/crt1.o /opt/SUNWspro/prod/lib/crtn.o -o /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.Server-cltxm251/SSD.Server/ssdArther/Arther /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.Server-cltxm251/SSD.Server/ssdArther/arther.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.COMMON_CODE-cltxm25/SSD.COMMON_CODE/code.o/strings.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.COMMON_CODE-cltxm25/SSD.COMMON_CODE/code.o/Useful.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/get_tlv.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/reschedule_update.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/put_tlv.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/complete_update.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/update.o /usr/users/PLAT/cltxm25/ccm_wa/ssd/ssdGettlv-cltxm25/ssdGettlv/rollback_update.o -l clntsh `cat /u01/app/oracle/product/10.2.0/lib32/ldflags` -lthread -lbase -lgen -lmqm -lmqmcs -lmqmzse -lthread -ldl -lsocket -lnsl
ld: fatal: library -lbase: not found
ld: fatal: library -lmqm: not found
ld: fatal: library -lmqmcs: not found
ld: fatal: library -lmqmzse: not found
ld: fatal: File processing errors. No output written to /usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.Server-cltxm251/SSD.Server/ssdArther/Arther
*** Error code 1
make: Fatal error: Command failed for target `Arther'

Any help in this regard is Appreciated...

Siva

You need an -Ldirectory for the paths to the MQseries libraries.

That is awful if you need the "-o" in LDFLAGS. The -o option is a standard option and preceedes the output file designation, this works for ld, cc, c89, gcc, CC, etc.

LDFLAGS, CFLAGS and CXXFLAGS should contain things like optimatizations, code generation options, environment options etc.

One of the few things that should not really go in there is "-o". Looks like you started with a very poor makefile.

hi

from your makefile i conlude tha you create an executable named "Arther" not "arther"
does "/usr/users/PLAT/cltxm25/ccm_wa/ssd/SSD.Server-cltxm251/SSD.Server/ssdArther/Arther" exist befor you make your program?
mfg guenter