LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2012, 03:22 PM   #1
ssica
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Rep: Reputation: Disabled
Unhappy MAKEFILE ERROR:' make: *** No rule to make target `MacroCompletudeExe', needed by all


Hello,

I look everywhere with google why this error appears and I found many answers but I really do not see the mistake in my makefile

Can someone help me ?

Here is my Makefile :

OPTFLAG = -O2

CFLAGS = $(OPTFLAG) $(DBGFLAG)

#Paths "by hand" for headers
#cfitsio
#INC := -I$(HEAD_FITS)
HEAD_FITS = /Softwares/cfitsio/include/
INC := -I$(HEAD_FITS)
#NumRec Library
HEAD_NUMREC := /Users/jdemocle/These/Codes/Externlib/NumRec/
INC := $(INC) -I$(HEAD_NUMREC)/utils/
#BaseLib
HEAD_BASELIB := /Users/jdemocle/These/Codes/Olimpo/BaseNumRec/
INC := $(INC) -I$(HEAD_BASELIB)
#cmbeasy Library
HEAD_CMBEASY := /Users/jdemocle/These/Codes/Externlib/cmbeasy/Include/
INC := $(INC) -I$(HEAD_CMBEASY)
#ModelAmas library
#INC := $(INC) -I$(HEAD_AMAS)
# root
HEAD_ROOT = /Softwares/root/include/
INC := $(INC) -I/Softwares/root/include/
#Defaut
INC := $(INC) -I./

# Librairies
LIBS := /Users/jdemocle/These/Codes/Olimpo/ModelAmas/libModelAmasV1.a
LIBS := $(ROOTSYS)/lib
SRC = ./
EXE = ./
DOBJ = ./Objs/

all: MacroCompletude_BIAIS.o $(EXE)MacroCompletudeExe
#all: MacroCompletude_BIAIS.o
# inference rule saying that .o file are computed from .cpp file using the following shell line
MacroCompletude_BIAIS.o : MyGeneralFunc.hpp FitsLib.hpp $(HEAD_ROOT)/TMarker.h \
$(HEAD_ROOT)/TROOT.h $(HEAD_ROOT)/TPad.h $(HEAD_ROOT)/TFile.h $(HEAD_ROOT)/TH1.h $(HEAD_ROOT)/TProfile.h \
$(HEAD_ROOT)/TH2.h $(HEAD_ROOT)/TStyle.h $(HEAD_ROOT)/TChain.h $(HEAD_ROOT)/TLeaf.h $(HEAD_ROOT)/TCanvas.h \
$(HEAD_ROOT)/TPaveLabel.h $(HEAD_ROOT)/TTree.h $(HEAD_ROOT)/TNtuple.h $(HEAD_ROOT)/TApplication.h \
$(HEAD_ROOT)/TRandom.h $(HEAD_ROOT)/TGraphErrors.h $(HEAD_ROOT)/TBox.h $(HEAD_ROOT)/TVector3.h \
$(HEAD_ROOT)/TVirtualFitter.h $(HEAD_ROOT)/TMatrixD.h $(HEAD_ROOT)/TMinuit.h $(HEAD_ROOT)/TMath.h $(HEAD_ROOT)/TLegend.h
g++ -c -O2 -I./ -I/Softwares/root/include/ -I/Softwares/cfitsio/include/ -I/Users/jdemocle/These/Codes/Externlib/NumRec/utils/ -I/Users/jdemocle/These/Codes/Olimpo/BaseNumRec/ \
-L/Users/jdemocle/These/Codes/Olimpo/ModelAmas/libModelAmasV1.a -L/Softwares/root/include/ MacroCompletude_BIAIS.cpp

$(DOBJ)%.o : %.cpp
$(COMPILE.cc) $(CFLAGS) -I$(INC) -L$(LIBS) -o $@ $<

FitsLib.o : $HEAD_BASELIB/fabtcolreadNR.h $HEAD_BASELIB/fabtwriterNR.h

#$(ROOTSYS)/lib/%.o : $(HEAD_ROOT)/%.h


$(EXE)MacroCompletudeEXE : MacroCompletude_BIAIS.o
g++ -o -L./ -lModelAmasV1 -L$(ROOTSYS)/lib MacroCompletude_BIAIS.o
 
Old 04-20-2012, 01:39 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
what make do you use?
 
Old 04-23-2012, 07:37 AM   #3
ssica
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi !

Sorry I didn't see your question but I don't really understand it :-/ well the make I use is in my post... The code I want to compile uses many different librairies and I changed a bit the makefile but now it seems that I have a problem with the ROOT library -.-"

My executable depends on MacroCompletude_BIAIS.o
I compile it doing

g++ -c -O2 -I/Softwares/cfitsio/include/ -I/Users/jdemocle/These/Codes/Externlib/NumRec//utils/ -I/Users/jdemocle/These/Codes/Olimpo/BaseNumRec/ -I/Users/jdemocle/These/Codes/Externlib/cmbeasy/Include/ -I/Softwares/root/include/ -I./ MacroCompletude_BIAIS.cpp

And it works fine.
I also need FitsLib.o that I compile the same way and it also works fine...
g++ -c -O2 -I/Softwares/cfitsio/include/ -I/Users/jdemocle/These/Codes/Externlib/NumRec//utils/ -I/Users/jdemocle/These/Codes/Olimpo/BaseNumRec/ -I/Users/jdemocle/These/Codes/Externlib/cmbeasy/Include/ -I/Softwares/root/include/ -I./ FitsLib.cpp

But then to make the executable MacroCompletudeEXE :
g++ -o MacroCompletudeEXE -O2 MacroCompletude_BIAIS.o FitsLib.o -L/Users/jdemocle/These/Codes/Externlib/lib/ -lcmbeasy -lBaselib -lcfitsio -L/Users/jdemocle/These/Codes/Olimpo/ModelAmas -lModelAmasV1 -L/Softwares/root/lib

It tells me :
Undefined symbols:
"TApplicationImp::ShowMembers(TMemberInspector&)", referenced from:
vtable for TApplicationImpin MacroCompletude_BIAIS.o
..."

which is a function of the ROOT library :-/ so once again I am stopped !
 
Old 04-23-2012, 08:32 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
the question was: which make software do you use? gmake, or some other variant. They have slightly different syntax.
you would try to use [code][/code] to format post, it looks like the lines are incomplete or not properly constructed.

for example when you create a .o file from a .cpp the flags -L<something> and -l<something> are ignored.
-L<something> is used to define directories where the linker will search libraries. The libraries should be used as -l<name> and should be placed after -L. So the last -L is useless in your commands.
I do not know what does ROOT library means.
 
Old 04-23-2012, 09:21 AM   #5
ssica
LQ Newbie
 
Registered: Apr 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ah ok ! I just type make -f MyMakefile so I use make
ROOT is a huge library I downloaded from http://root.cern.ch/drupal/content/downloading-root
And I suspect that it is the one that make the problem because I also tried with XCODE and it returns me the error that

Code:
ld: warning: in /Softwares/root/lib/libTree.so, file was built for unsupported file format which is not the architecture being linked (i386)
and indeed I downloaded the precompiled library which was compiled for x86-64 -.-" so I will try to download the source files and redo the whole process !
But about the makefile this is the error comes from the line :
Code:
g++ -o MacroCompletudeEXE -O2    MacroCompletude_BIAIS.o FitsLib.o -L/Users/jdemocle/These/Codes/Externlib/lib/ -lcmbeasy -lBaselib -lcfitsio -L/Users/jdemocle/These/Codes/Olimpo/ModelAmas -lModelAmasV1  -L/Softwares/root/lib
where what is behind the -L are directories and the -ltoto are just to specify the names of the libraries (for example -lcmbeasy is for libcmbeasy.a)... tell me if you see a big mistake ^^"
Thank you a lot !
 
Old 04-23-2012, 10:56 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,450

Rep: Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776Reputation: 2776
ok, so can you execute the following commands:
file /Softwares/root/lib/libTree.so
file MacroCompletude_BIAIS.o

usually the flags -L and -l are used together, -L will specify the directory and -l the lib. The flag -L must appear before -l, otherwise the linker will not be able to use that directory to resolve that library. So the -L/Softwares/root/lib is useless in the second command - or just missing the flag -lTree?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NS 2 compilation error: make: *** No rule to make target ‚??VERSION‚??, needed by ‚??gen/ve Marz22 Linux - Newbie 8 11-21-2011 02:20 AM
Error in Makefile:No rule to make target `g++',needed by... stop karthik.c Programming 5 03-09-2009 12:55 AM
Help needed for make file problem : make: *** No rule to make target `flash', needed rameshsatyavaram Linux - Newbie 3 09-11-2008 02:13 AM
Belkin Wirless G RTL8185L make[1]: *** No rule to make target `Makefile'. Stop. SilverRock Linux - Wireless Networking 2 02-11-2007 07:25 AM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration