Menu

1.07 compile error

2004-07-09
2004-07-09
  • Nobody/Anonymous

    cc -c -g -pg -Wall -ftemplate-depth-30   -I../include  shared_memory.cc -o shared_memory.o
    In file included from shared_memory.cc:21:
    ../include/shared_memory.h:704: conflicting types for `class map<basic_string<char,string_char_traits<char>,__default_alloc_t
    emplate<true,0> >,pair<void *,mem_space::stat<alloc_key,alloc_addr> >,less<basic_string<char,string_char_traits<char>,__defau
    lt_alloc_template<true,0> > >,allocator<pair<void *,mem_space::stat<alloc_key,alloc_addr> > > > mem_space::shared<alloc_key,a
    lloc_addr>::mappings'
    ../include/shared_memory.h:641: previous declaration as `class map<basic_string<char,string_char_traits<char>,__default_alloc
    _template<true,0> >,pair<void *,mem_space::stat>,less<basic_string<char,string_char_traits<char>,__default_alloc_template<tru
    e,0> > >,allocator<pair<void *,mem_space::stat> > > mem_space::shared<alloc_key,alloc_addr>::mappings'
    shared_memory.cc: In method `mem_space::locks::locks(const char *const &, const int &)':
    shared_memory.cc:50: implicit declaration of function `int mem_space::perror(...)'
    make[1]: *** [shared_memory.o] Error 1

     
    • Marc Bumble

      Marc Bumble - 2004-07-09

      There is a new version about to surface.  In that version, the lower static definition, at line 704 now uses the type
      typename shared<alloc_key, alloc_addr>::mappings_t to be consistent with the earlier definitiion of mappings. 

      In the error messagse above, the stat structure at line 704 seems to be taking template parameter, but stat is just a normal structure which does not take parameters.  Looks like a compiler issue.  Don't see a problem.

      perror is defined in error.h which is included in shared_memory.h

      Marc

       
    • Nobody/Anonymous

      sorry, my gcc version is 2.95.3
      Can I complie it ?

       
      • Marc Bumble

        Marc Bumble - 2004-07-09

        The allocator uses template parameter values, not just types, so you may need a compiler or OS upgrade.  I am using

        gcc --version
        gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
        Copyright (C) 2002 Free Software Foundation, Inc.
        This is free software; see the source for copying conditions.  There is NO
        warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

        Marc

         

Log in to post a comment.

MongoDB Logo MongoDB