This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Allocator - OK but...


Hi all,

I've got a bunch of code and in stead of using the std::string I use my
own string 'y_string', which is defined as follows. I use my own
specific stringAllocator class (see below) as allocator for this
y_string:

#include <std/bastring.h>
#include "alloc.h"

class y_stringAllocator {
  public:
        static void * allocate(size_t n);
        static void deallocate(void *p, size_t n);
        static void *reallocate(void *p, size_t old_sz, size_t new_sz);

        static void getStatistics(y_uint32 * nbrstrings, y_uint32
*nbrbytes);
};

typedef basic_string<char, string_char_traits<char>,
        y_stringAllocator> y_string;

On Linux everything works fine. On DEC Alpha XP900 with gcc version
2.95.3 I get no problems compiling this into a libstring.a library, but
when it comes to finally linking everything together I get:

/usr/bin/ld:
Unresolved:
basic_string<char, string_char_traits<char>,
y_stringAllocator>::nilRep
collect2: ld returned 1 exit status

The libraries I link with are:
-lrt -lm -lc -lstdc++  -lstring -lstdc++

Any ideas?

Thanks in advance,

Jan Mannekens


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]