On Tue, 25 Apr 2000, Angus Leeming wrote:
> Allan, this one is for you I think.
>
> Attempting to compile the rae branch of CVS with gcc-2.95.2 and
> lyxstring I get the follwing at linking:
>
> Unresolved:
> overflow_error::overflow_error(lyxstring const &)
>
> This makes sense. In xtl/objio.h we have:
>
> class mem_buffer {
> ...
>
> public:
> class buffer_overflow_error: public std::overflow_error {
> public:
> int bytes_left;
> int bytes_needed;
>
> buffer_overflow_error(int left, int needed):
> std::overflow_error("XTL mem_buffer overflow"),
> bytes_left(left),bytes_needed(needed) {}
> };
> ...
> };
> (This is true also of auto_mem_buffer.)
>
> The code compiles because of the jiggery-pokery in LString.h, but
> std::overflow_error knows nothing about lyxstring and so the link fails.
>
> Any ideas?
I think this problem and those reported by cxx are due to not enough
jiggery-pokery in LString.h. XTL's methods are written as:
void input_simple(std::string &);
for example, but we only:
typedef lyxstring string;
We should probably apply two fixes -- one to XTL for namespace usage and
one to LString.h to place lyxstring into std namespace if namespaces are
being used. I'm not quite sure how best to go about making sure that
std::string corresponds to lyxstring though. DO we need to put namespace
std {..} around lyxstring.h? or is it possible to just do:
typedef lyxstring std::string;
Anyone with namespace experience/knowledge/textbook care to comment?
Allan. (ARRae)