The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 10:21 AM
Warning message while makefile compilation nsurendiran UNIX for Dummies Questions & Answers 0 12-04-2007 05:36 AM
Issue with makefile compilation nsurendiran UNIX for Dummies Questions & Answers 3 12-03-2007 06:00 AM
Issue with Makefile compilation nsurendiran High Level Programming 1 12-03-2007 12:16 AM
about create Makefile mzp High Level Programming 0 11-07-2002 03:18 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-11-2007
sivalives sivalives is offline
Registered User
  
 

Join Date: Aug 2007
Location: INDIA
Posts: 4
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
  #2 (permalink)  
Old 08-11-2007
porter porter is offline Forum Advisor  
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.
  #3 (permalink)  
Old 08-11-2007
sivalives sivalives is offline
Registered User
  
 

Join Date: Aug 2007
Location: INDIA
Posts: 4
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
  #4 (permalink)  
Old 08-11-2007
porter porter is offline Forum Advisor  
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"
  #5 (permalink)  
Old 08-13-2007
sivalives sivalives is offline
Registered User
  
 

Join Date: Aug 2007
Location: INDIA
Posts: 4
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
  #6 (permalink)  
Old 08-13-2007
porter porter is offline Forum Advisor  
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.
  #7 (permalink)  
Old 08-13-2007
porter porter is offline Forum Advisor  
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0