[vtkusers] Compiling VTK 6.1.0 fails with errors like "no matching function for call to ‘operator new(long unsigned int, void*)’"

Omid omidlink at gmail.com
Thu Mar 6 17:57:13 EST 2014


Hello,

I am trying to compile VTK 6.1.0. After configuring with

ccmake .

with the following configuration

BUILD_DOCUMENTATION              OFF
BUILD_EXAMPLES                   OFF
BUILD_SHARED_LIBS                ON
BUILD_TESTING                    OFF
CMAKE_BUILD_TYPE                 Debug
CMAKE_INSTALL_PREFIX             $OPT
EXECINFO_LIB                     EXECINFO_LIB-NOTFOUND
VTK_EXTRA_COMPILER_WARNINGS      OFF
VTK_Group_Imaging                OFF
VTK_Group_MPI                    OFF
VTK_Group_Qt                     OFF
VTK_Group_Rendering              ON
VTK_Group_StandAlone             ON
VTK_Group_Tk                     OFF
VTK_Group_Views                  OFF
VTK_Group_Web                    OFF
VTK_SMP_IMPLEMENTATION_TYPE      Sequential
VTK_USE_LARGE_DATA               OFF
VTK_WRAP_JAVA                    OFF
VTK_WRAP_PYTHON                  OFF
VTK_WRAP_TCL                     OFF

I get the following compile error upon invoking make:

/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_algobase.h:544:
error: no type named ‘difference_type’ in ‘struct
std::iterator_traits<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*>’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_algobase.h:544:
error: no type named ‘difference_type’ in ‘struct
std::iterator_traits<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*>’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_algobase.h:544:
error: no type named ‘difference_type’ in ‘struct
std::iterator_traits<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*>’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_algobase.h:544:
error: no type named ‘difference_type’ in ‘struct
std::iterator_traits<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*>’
In file included from
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/vector:64,
                 from
/panfs/storage.local/genacc/home/ok10c/software/VTK-6.1.0/Utilities/KWSys/vtksys/stl/vector:36,
                 from
/panfs/storage.local/genacc/home/ok10c/software/VTK-6.1.0/Utilities/KWSys/vtksys/Directory.cxx:20:
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_uninitialized.h:
In static member function ‘static _ForwardIterator
std::__uninitialized_copy<<anonymous>
>::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator)
[with _InputIterator = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, _ForwardIterator = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*, bool <anonymous> = false]’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_uninitialized.h:117:
  instantiated from ‘_ForwardIterator
std::uninitialized_copy(_InputIterator, _InputIterator,
_ForwardIterator) [with _InputIterator = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*, _ForwardIterator =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >*]’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_uninitialized.h:257:
  instantiated from ‘_ForwardIterator
std::__uninitialized_copy_a(_InputIterator, _InputIterator,
_ForwardIterator, std::allocator<_Tp>&) [with _InputIterator =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >*,
_ForwardIterator = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, _Tp = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >]’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_uninitialized.h:267:
  instantiated from ‘_ForwardIterator
std::__uninitialized_move_a(_InputIterator, _InputIterator,
_ForwardIterator, _Allocator&) [with _InputIterator =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >*,
_ForwardIterator = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, _Allocator =
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > >]’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/vector.tcc:338:
  instantiated from ‘void std::vector<_Tp,
_Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename
std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer,
std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
_Alloc = std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > >]’
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_vector.h:741:
  instantiated from ‘void std::vector<_Tp, _Alloc>::push_back(const
_Tp&) [with _Tp = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, _Alloc = std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >]’
/panfs/storage.local/genacc/home/ok10c/software/VTK-6.1.0/Utilities/KWSys/vtksys/Directory.cxx:226:
  instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/bits/stl_uninitialized.h:74:
error: no matching function for call to ‘operator new(long unsigned int,
void*)’
<built-in>:0: note: candidates are: void* operator new(long unsigned int)
make[2]: ***
[Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/Directory.cxx.o] Error 1
make[1]: *** [Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all] Error 2
make: *** [all] Error 2

I think the reason could be that the gcc compiler is too old (4.4.6)
and may not support some of the newer language features (like new). I
installed the latest stable gcc (4.8.2) and tried instructing ccmake
to use the new gcc using

env CC=$(which gcc) CXX=$(which gcc) ccmake .

or

CC=$(which gcc) CXX=$(which gcc) ccmake .

where $(which gcc) returns the path to the new gcc. But the output and
the errors are still the same (referring to gcc 4.4.6). It looks like
the new gcc is not picked up by ccmake. Doing a find grep, I don't
see where the CC or CXX variable may have been set (they are not in
the Makefile). Any help towards solving this is greatly appreciated.

-- 
Omid

Sent from my Emacs


More information about the vtkusers mailing list