On Thu, 27 Jul 2000, Cherlin Alexander wrote:
> Hello,
> I try to compile my stuff and this is the error which I get:
>
> -lmathlib -lpacklib -lkernlib -lg2c -lc -L/usr/X11R6/lib -lXpm
> -lX11 -lm -lXt -lXext -lXi -ldl -lpthread
> -L/home/cerescdr/display/irix/lib -lXm -lXp -L/srv01/cgrp/phenix/root/lib
> -lNew -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint
> -lPostscript -lMatrix -lPhysics -lm -ldl -rdynamic
> /srv01/cgrp/phenix/root/lib/libCore.so: undefined reference to `__log1p'
> collect2: ld returned 1 exit status
> make: *** [analyze] Error 1
Looks like g++ options...
That's what I use on a linux-i686 workstation, also compiling with some
bits of fortran code as you seems to use (lg2c), and cernlib.
(part of the Makefinle of interest)
<<<<<<<<<<<<<<<<<
CPC = egcs
LD = egcs
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --libs)
ROOTGLIBS = $(shell root-config --glibs)
COMMONFLAGS = -O3 -mpentiumpro
CPCflags = $(COMMONFLAGS) \
-I$(ROOTSYS)/include
CPCsharedflags= -KPIC \
$(COMMONFLAGS) $(WARNINGFLAGS) -I$(ROOTSYS)/include
CPCDICflags = -KPIC \
$(COMMONFLAGS) $(WARNINGFLAGS) -I$(ROOTSYS)/include
ldflags = $(COMMONFLAGS) -Wall \
$(ROOTLIBS) \
-L$(CERNLIB) -lpacklib -lmathlib -lkernlib \
-lgraflib -lpawlib \
-lm -lc -ldl -rdynamic \
-lg2c
CPFflags = $(COMMONFLAGS) -Wall -fno-second-underscore
.SUFFIXES :
.SUFFIXES : .cpp .cxx .H .C .f .dict_o .o
# The app
$(ORLYSE):
@$(LD) \
$(OBJLYSE) $(OBJSHARED) $(OBJDICT) \ # my objects
$(ldflags) \
-o $(ORLYSE)
#The shared lib
$(ROOTSHARED): $(OBJDICT) $(OBJSHARED)
@$(LD) $(OBJDICT) $(OBJSHARED) $(COMMONFLAGS) \
-shared -o $(ROOTSHARED)
.cpp.o:
@echo compilation of $<
$(CPC) $(CPCflags) $< -c -o $@
.cxx.o:
@echo compilation of shared $<
$(CPC) $(CPCsharedflags) $< -c -o $@
.f.o:
@echo compilation of $<
$(CPF) $(CPFflags) $< -c -o $@
.H.C:
@echo "Generating dictionary ..."
@rootcint $@ -c -DFOR_SHARE $<
.C.dict_o:
@echo compilation of dico $<
$(CPC) $(CPCDICflags) $< -c -o $@
>>>>>>>>>>>>>>
Of course most of this stuff is crap (but "if it works, dont fix it" ;)
and could be written better.
I name CINT generated objects .dict_o and the code I want to share is in
.cxx files (other code is in .cpp files).
I cant tell what you forget there, most of the time the problems comes
from the fact that you declare your symbols too early. Maybe the -lc and
-lg2c libs should be near the end, after the cernlib declarations.
If you are really using g++ (or egcs) on a linux-ix86, I can send you
the full Makefile and an 'env' dump if nobody gives ou the answer in
two lines :)
Yannick
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:30 MET