Makefile compilation Error -Unable to create executable


 
Thread Tools Search this Thread
Top Forums Programming Makefile compilation Error -Unable to create executable
# 1  
Old 08-11-2007
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  
Old 08-11-2007
Quote:
Originally Posted by sivalives
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  
Old 08-11-2007
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  
Old 08-11-2007
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  
Old 08-13-2007
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  
Old 08-13-2007
Quote:
Originally Posted by sivalives
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  
Old 08-13-2007
Quote:
Originally Posted by sivalives
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

ACLs - How can i create new executable files

Hello experts, I would like to know if is possible to create a default acl rule to a directory. in this directory all files created should have executable permissions by the group IT. i tried setfacl -m d:g:it:rwx /files tried to change the mask setfacl -m m::rwx /files but i still... (3 Replies)
Discussion started by: berveglieri
3 Replies

2. Solaris

Compilation - unable to finding include files

Hey there, This is gotta be a stupid question, if there ever was one, but I am learning a lot by asking such questions. Now I am trying to build this humungous library, which has all kinds a dependencies, which I realize as it makes, and i download all those dependent libs. The compilation is... (1 Reply)
Discussion started by: shriyer123
1 Replies

3. Programming

Makefile for more than 1 executable program

Can anyone give me a makefile that creates 3 exe?for example, let's suppose i have the following files: blah1.c blah1.h blah2.c blah2.h blah3.c blah3.h i've searched and searched but so far i was not able to complete it. (4 Replies)
Discussion started by: bashuser2
4 Replies

4. Shell Programming and Scripting

Unable to make script executable

Hello everybody, I'm unable to make my shell script an executable file. The details are as follows: PATH includes my $HOME/bin i.e. /rchome/rc1/bin HOME directory is /rchome/rc1 script name is prep_mig.sh permissions set are 755 It's executing if I give below command sh prep_mig.sh but... (4 Replies)
Discussion started by: jitu.keshwani
4 Replies

5. Shell Programming and Scripting

Unable to call executable from script

Now I am using the HP-UX11.11 version. The scripts are runninh in KSH shell. While I wan to call one executable of any Pro*C file, I have got the following error, however the executable is running fine directly. testpri Started at 10.05.200923:40 /usr/lib/dld.sl: Bad magic number for... (0 Replies)
Discussion started by: priyankak
0 Replies

6. UNIX for Advanced & Expert Users

Makefile conditional compilation giving error

Hi , Please answer my query: I want to create a common make file for one of mylibrary such that it should work on both Sun as well as Linux on 32 and 64 bit system. The flow is sth like this: .............. .............. if$(OS) == solaris BINDIR= ../../lib/solaris/64 else BINDIR=... (1 Reply)
Discussion started by: unisuraj
1 Replies

7. UNIX for Dummies Questions & Answers

Warning message while makefile compilation

Hi all, I am trying to create an executable, but when the .pc file converting to .c file I am getting lots of warning message like of these 3 lines. Any idea why I am getting these lines? Any configuration issues? What exactly needs to be done to solve these warning messages? ... (0 Replies)
Discussion started by: nsurendiran
0 Replies

8. UNIX for Dummies Questions & Answers

Issue with makefile compilation

All, I am facing problem with one makefile compilation. The following is the error I am getting, Before proceeding to this I want to let you know all, only last week onwards I started working in solaris10, the same code is working in solaris 9. I dont know any link has to be created, or any path... (3 Replies)
Discussion started by: nsurendiran
3 Replies

9. Programming

Issue with Makefile compilation

All, I am facing problem with one makefile compilation. The following is the error I am getting <Code> /applns/ora10/rdbms/bin/proc sqlcheck=semantics userid=/ CHAR_MAP=VARCHAR2 DBMS=V7 DEFINE=UNIX DEFINE=SUN_SRC_COMPAT iname=mm5900.pc sh: /applns/ora10/rdbms/bin/proc: not found *** Error... (1 Reply)
Discussion started by: nsurendiran
1 Replies

10. Programming

about create Makefile

hello! i want to create a Makefile on the freebsd 4.5,so i vi the hello.c #include int main(int argc, char** argv) { printf(''Hello, GNU!\n''); return 0; } #autoscan #cp configure.scan configure.in #vi configure.in modify:AC_OUTPUT AC_OUTPUT(Makefile) #aclocal #autoconf... (0 Replies)
Discussion started by: mzp
0 Replies
Login or Register to Ask a Question