The following simple volcalc.cpp code compiles with no errors (and
works) in Windows Visual C++.
With g++ v.4.3.2 instead I get the reported error.

I would thankfully appreciate any help.

volcalc.cpp:26: error: template argument for ‘template<class _Alloc>
class std::allocator’ uses local type ‘main(int, char**)::series’
volcalc.cpp:26: error:   trying to instantiate ‘template<class _Alloc>
class std::allocator’
volcalc.cpp:26: error: template argument 2 is invalid
volcalc.cpp:66: error: request for member ‘resize’ in ‘alldata’, which
is of non-class type ‘int’

int main(int argc, char *argv[])
{
        struct series {
                ....
        };
        int nr;
....
        vector<series> alldata;   // line 26

....    // calculate nr;

        alldata.resize(nr);  // line 66

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to