The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to create alias mumashankar UNIX for Dummies Questions & Answers 3 05-01-2008 07:21 AM
Warning message while makefile compilation nsurendiran UNIX for Dummies Questions & Answers 0 12-04-2007 01:36 AM
Issue with makefile compilation nsurendiran UNIX for Dummies Questions & Answers 3 12-03-2007 02:00 AM
Issue with Makefile compilation nsurendiran High Level Programming 1 12-02-2007 08:16 PM
about create Makefile mzp High Level Programming 0 11-06-2002 11:18 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-11-2007
Registered User
 

Join Date: Aug 2007
Location: INDIA
Posts: 3
Question 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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-11-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by sivalives View Post
Arther: arther.o strings.o Useful.o
ld .... -o $(PROC_PREFIX)Arther ...
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.
Reply With Quote
  #3 (permalink)  
Old 08-11-2007
Registered User
 

Join Date: Aug 2007
Location: INDIA
Posts: 3
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
Reply With Quote
  #4 (permalink)  
Old 08-11-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
A makefile rule is as follows


Code:
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"
Reply With Quote
  #5 (permalink)  
Old 08-13-2007
Registered User
 

Join Date: Aug 2007
Location: INDIA
Posts: 3
fatal: library -lbase: not found

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
Reply With Quote
  #6 (permalink)  
Old 08-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by sivalives View Post
ld: fatal: library -lbase: not found
ld: fatal: library -lmqm: not found
ld: fatal: library -lmqmcs: not found
ld: fatal: library -lmqmzse: not found
You need an -Ldirectory for the paths to the MQseries libraries.
Reply With Quote
  #7 (permalink)  
Old 08-13-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by sivalives View Post
LDFLAGS=-o
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0