Menu

#2 Compilation on GCC 4.3.3

open
nobody
None
8
2012-09-15
2009-04-24
No

When compiling with GCC 4.3.3 the following error message is reported:

calcFuncs.C:327: instantiated from here
/usr/include/c++/4.3/bits/stl_vector.h:932: error: no matching function for call to ‘std::vector<std::vector\<float, std::allocator\<float=""> >, std::allocator\<std::vector\<float, std::allocator\<float=""> > > >::_M_fill_initialize(size_t, int&)’
/usr/include/c++/4.3/bits/stl_vector.h:974: note: candidates are: void std::vector<_Tp, _Alloc>::_M_fill_initialize(size_t, const _Tp&) [with _Tp = std::vector<float, std::allocator\<float=""> >, _Alloc = std::allocator<std::vector\<float, std::allocator\<float=""> > >]</std::vector\<float,></float,></std::vector\<float,></std::vector\<float,>

Discussion

  • Don Pellegrino

    Don Pellegrino - 2009-04-24

    The following modifications were used for compilation to get to the calcFuncs.C:327 error:

    $ svn diff
    Index: trunk/include/particleContainerChaperone.hpp
    ===================================================================
    --- trunk/include/particleContainerChaperone.hpp (revision 8)
    +++ trunk/include/particleContainerChaperone.hpp (working copy)
    @@ -29,6 +29,7 @@
    #include <iostream>
    #include <fstream>
    #include <string>
    +#include <cstring></cstring></string></fstream></iostream>

    //----------------------------------------------------

    Index: trunk/include/grid.hpp

    --- trunk/include/grid.hpp (revision 8)
    +++ trunk/include/grid.hpp (working copy)
    @@ -25,6 +25,8 @@
    #include "fixedVec.hpp"
    #include <cassert>
    #include <iostream>
    +#include <cstdlib>
    +</cstdlib></iostream></cassert>

    //------------------------------------------------------------

    Index: trunk/include/configs.h

    --- trunk/include/configs.h (revision 8)
    +++ trunk/include/configs.h (working copy)
    @@ -23,7 +23,7 @@
    //------------------------------------------------------

    typedef float prec_t;
    -const unsigned int DIMENSION = 3;
    +const unsigned int DIMENSION = 2;

    //------------------------------------------------------

    Index: trunk/src/Makefile

    --- trunk/src/Makefile (revision 8)
    +++ trunk/src/Makefile (working copy)
    @@ -1,7 +1,7 @@
    CPP=c++

    #CPP_FLAGS=-Wall -ftemplate-depth-30
    -CPP_FLAGS=-Wall -g -ftemplate-depth-50
    +CPP_FLAGS=-Wall -g -ftemplate-depth-50 -fpermissive -Wno-deprecated

    SOURCES= lglayout.C calcFuncs.C
    OBJECTS= lglayout.o calcFuncs.o

     
  • Don Pellegrino

    Don Pellegrino - 2009-04-27

    It seems this issue is related to the initialization of VV. As a workaround removing the second parameter gets compilation to complete successfully:

    Index: trunk/include/sphere.hpp

    --- trunk/include/sphere.hpp (revision 8)
    +++ trunk/include/sphere.hpp (working copy)
    @@ -96,7 +96,7 @@
    {
    typedef std::vector< typename Sphere::vec_type > VV;
    typedef typename Sphere::vec_type vec_type;
    - VV v( count , s.dimension() );
    + VV v( count );
    for ( int ii=0; ii<count; ++ii ) {
    v[ii] = randomPointOnSurface( s );
    }

    Unfortunately this changes the initialization. The original should assign a value to each element of the vector while the work-around does not.

     

Anonymous
Anonymous

Add attachments
Cancel