Hi,
I need to use a different compiler that I built (don’t ask; long story!) rather than use the default compiler. So I notice this option in configure from the --help option:
[i]with compiler options, prefix with --with-, overrides default value
cc alternative C compiler and options to be used
cxx alternative C++ compiler and options to be used
f77 alternative Fortran compiler and options to be used[/i]
So I configured it with this option:
–with-cxx=/home/jade/gcc-4.8.0/local/bin/gcc
So when I run make, how do I know it’s picking up the correct include that corresponds to the compiler version and not looking at the default /usr/include? I have set the LD_LIBRARY_PATH to first look in /home/jade/gcc-4.8.0/local/lib64, to make sure it picks up the library that matches with the compiler. But how does one make sure it’s picking up the right include that’s consistent to the compiler?
I only ask this because when I run make, I get a linking error … it can’t find standard C++ ostream, strings, among other things:
History.cpp:(.text+0x29e): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:
:__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char
const*, long)'
History.cpp:(.text+0x2bb): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:
:__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char
const*, long)'
My guess is that it’s not picking up the right include that matches the library (that is it is probably picking up the default in /usr/include). I looked at the compilation line and there’s nothing there that indicates that it’s picking up the include that’s consistent to the compiler I suggested. For instance, here’s one compilation line:
gcc -O2 -pipe -m64 -Wall -W -fPIC -Iinclude -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -I/home/jade/root/cint/cint/inc -I/home/jade/root/cint/cint/src -I/home/jade/root/cint/cint/src/dict -pthread -I. -o cint/cint/src/g__cfunc.o -c /home/jade/root/cint/cint/src/g__cfunc.c
bin/rmkdepend -R -fcint/cint/src/config/strlcpy.d -Y -w 1000 -- -pipe -m64 -Wall -W -fPIC -Iinclude -DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION -DG__64BIT -DG__HAVE_CONFIG -DG__NOMAKEINFO -DG__CINTBODY -I/home/jade/root/cint/cint/inc -I/home/jade/root/cint/cint/src -I/home/jade/root/cint/cint/src/dict -pthread -I. -- /home/jade/root/cint/cint/src/config/strlcpy.c
As an alternative, I didn’t bother with the --with-cxx and made sure that my $PATH had /home/jade/gcc-4.8.0/local/bin, so that it picked up the preferred gcc, but I still get the same build error. It’s the same problem … how do I know it’s picking up the correct include that’s consistent to the compiler? I thought the --with-cxx would fix the problem, but it did not. Any advice? I attached my config.log
savconfig.txt (282 KB)