POV-Ray : Newsgroups : povray.off-topic : C++ question : Re: C++ question Server Time
28 Jul 2024 16:26:40 EDT (-0400)
  Re: C++ question  
From: Warp
Date: 3 Oct 2013 13:15:49
Message: <524da645@news.povray.org>
Anthony D. Baye <Sha### [at] spamnomorehotmailcom> wrote:
> undefined reference to `geometry::operator<<(std::basic_ostream<char,

You have declared that function, but apparently you have not
implemented it anywhere, therefore the linker cannot find it when
you try to use it.

>         friend ostream &operator <<(ostream &, const point3d &);

Ostensibly that function will probably not need anything from your
class that isn't readable through its public interface. It's of course
not wrong, but it would be better to avoid making it a friend function
unless there's a good reason for that.

Just declare it as a function inside your 'geometry' namespace
(and then implement it somewhere, of course.)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.