Hi,
This is the same principle for libraries:
LDFLAGS = -O $(shell root-config --libs)
...
$(CXX) $(CXXFLAGS) -I$(ROOTSYS)/include walt.cxx -o walt \
$(LDFLAGS)
Cheers,
Philippe.
-----Original Message-----
From: Jianrong Deng [mailto:jdeng@cdfsga.fnal.gov]
Sent: Wednesday, July 02, 2003 7:51 PM
To: Philippe Canal
Cc: roottalk@pcroot.cern.ch
Subject: RE: [ROOT] compiling error
Hi Philippe,
Thank you for your help. After adding to my compile line "$(shell
root-config --cflags)" as you
suggested, I get rid of the incompatible complain.
But, there is a new error message. It seems something is
wrong with the math lib. But I don't know how to fix it.
Thank you in advance,
Jianrong
---------------------------------------------------
KCC --one_instantiation_per_object -fPIC +K0 --no_exceptions
--signed_chars -D_EXTERN_INLINE=inline --diag_suppress 191
-I/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/include
-I/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/include walt.cxx
-o walt \
-L/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib -lCore -lCint
\
-lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit \
-lPostscript -lProof -lTree \
-lGpad -lGui -lGX11 -lRint \
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCint.so:
undefined reference to `fabs'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `log'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `sqrt'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `cosh'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `ceil'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `floor'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCint.so:
undefined reference to `fmod'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `cos'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `tanh'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `sin'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `atan2'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `pow'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `sinh'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `log10'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `exp'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `tan'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `atan'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `asin'
/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so:
undefined reference to `acos'
collect2: ld returned 1 exit status
make: *** [walt] Error 1
-----------------------------------------------------------
Here is my new Makefile:
----------------------------------------------------------
ARCH = linuxkcc
ifeq ($(ARCH),linuxkcc)
# Linux with the KAI compiler
CXX = KCC --one_instantiation_per_object
CXXFLAGS = -fPIC +K0 $(shell root-config --cflags)
LD = KCC
LDFLAGS = -O $(shell root-config --cflags)
SOFLAGS =
endif
ifeq ($(ARCH),linuxrh51)
# Linux with gcc 2.7.2.x
CXX = g++
CXXFLAGS = -O -Wall -fPIC
LD = g++
LDFLAGS = -O
SOFLAGS = -shared
endif
walt:
$(CXX) $(CXXFLAGS) -I$(ROOTSYS)/include walt.cxx -o walt \
-L$(ROOTSYS)/lib -lCore -lCint \
-lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit \
-lPostscript -lProof -lTree \
-lGpad -lGui -lGX11 -lRint \
------------------------------------------------------------------
On Wed, 2 Jul 2003, Philippe Canal wrote:
> Hi,
>
> As the compiler kindly expressed:
> the setting of --[no_]thread_safe and/or --[no_]exceptions in
> /home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib/libCore.so is
> incompatible with previous file(s) in this link.
>
> you are trying to link C++ files that have compiled in modes that are not
> compatible. In this case you have compiled your code with exceptions
> enabled, while the ROOT distribution you are using is compiled with
> exceptions disabled
>
> Each ROOT distribution provide you with the correct list of flags and
> libraries to be compiled and link with via the root-config utility.
>
> Make sure you add the result of
> root-config --cflags
> to your compile line:
> CXXFLAGS = -fPIC +~K0 $(shell root-config --cflags)
>
> Cheers,
> Philippe
>
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Jianrong Deng
> Sent: Wednesday, July 02, 2003 4:07 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] compiling error
>
>
>
> Dear roottalk,
>
> I get the following message when I compile the file walt.cxx with
> Makefile. I have no idea what is wrong. How can I fix it?
>
> Thank you,
> Jianrong
>
> --------------------------------------
> KCC --one_instantiation_per_object -fPIC +K0
> -I/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/include walt.cxx
> -o walt \
> -L/home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/lib -lCore -lCint
> \
> -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit \
> -lPostscript -lProof -lTree \
> -lGpad -lGui -lGX11 -lRint \
>
> Error: The setting of --[no_]thread_safe and/or --[no_]exceptions in
> /home/cdfsoft/products/root/v3_03_07cKCC_4_0/Linux+2.2/l~ib/libCore.so
is
> incompatible with previous file(s) in this link.
> make: *** [walt] Error 2
>
> ------------------------------------
>
> The file walt.cxx is as following:
>
> -------------------------------------
>
> // program walt.cxx
> #include "TRint.h"
> #include "TCanvas.h"
> #include "TLine.h"
>
> int main(int argc, char **argv) {
> TRint theApp("Rint", &argc, argv);
> TCanvas *c1 = new TCanvas();
> TLine *l = new TLine(.1,.2,.8,.7);
> l->Draw();
>
> theApp.Run();
> return 0;
> }
>
> ------------------------------------------
>
> And the Makefile is :
>
> ------------------------------------------
>
> ARCH = linuxkcc
>
> ifeq ($(ARCH),linuxkcc)
> # Linux with the KAI compiler
> CXX = KCC --one_instantiation_per_object
> CXXFLAGS = -fPIC +K0
> LD = KCC
> LDFLAGS = -O $(shell root-config --cflags)
> SOFLAGS =
> endif
>
> walt:
> $(CXX) $(CXXFLAGS) -I$(ROOTSYS)/include walt.cxx -o walt \
> -L$(ROOTSYS)/lib -lCore -lCint \
> -lGraf -lGraf3d -lHist -lHtml -lMatrix -lMinuit \
> -lPostscript -lProof -lTree \
> -lGpad -lGui -lGX11 -lRint \
>
>
> ------------------------------------------------------------
>
>
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:13 MET