This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Allocator - OK but...
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Subject: Allocator - OK but...
- From: Jan Mannekens <Jan dot Mannekens at alcatel dot be>
- Date: Fri, 29 Jun 2001 14:27:14 +0200
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