List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:June 12 2005 9:20am
Subject:Re: Link errors with resetdb example program
View as plain text  
On Fri, Jun 10, 2005 at 03:32:07PM -0600, Warren Young wrote:
> Can you now try linking a basic "hello, world" type program against 
> libmysql++?  If you have to include something in the program to make 
> sure it uses the library, use something peripheral within the library, 
> like string2stream, or some of the primitive C type stuff in convert.h. 
>  You might find the #include graphs in the reference manual helpful 
> here: choose something that doesn't eventually depend on query.h, or 
> even row.h, connection.h, or coldata.h.

I'd recommend using the same program that Jonathan Wakely used in that
earlier thread Warren posted:
	http://gcc.gnu.org/ml/libstdc++/2004-09/msg00125.html

    #include <istream>
    #include <ostream>

    template <typename C>
    class Test : public std::basic_iostream<C>
    {
    public:
        Test() : std::basic_iostream<C>(0) {}
    };

    #include <iostream>

    int main()
    {
        Test<char> t;
        std::cout << '\n';
    }

The iostream classes were designed with inheritance in mind, so inheriting
(and the destructors) shouldn't cause a problem.


> If the changes to Query will happen, it will 
> happen during the v2.0 development.  It is not yet certain that it will 
> happen, because all known problems presently have reasonable 
> workarounds.  So far, the best reason I have to change it is that Scott 
> Meyers said so.  Not the best reason...

The reason to get rid of stream inheritance would be the copying that
Query objects might do, not the inheritance itself.  And these link errors
all reference the destructor, which doesn't have anything to do with
copying, in my opinion.

Has anyone emailed Jonathan Wakely?  Maybe he would remember what he did
to fix his problem.  The thread doesn't seem to finish completely.

- Chris

Thread
Link errors with resetdb example programDale Smith8 Jun
  • Re: Link errors with resetdb example programChris Frey8 Jun
    • Re: Link errors with resetdb example programDale Smith8 Jun
      • Re: Link errors with resetdb example programChris Frey8 Jun
        • Re: Link errors with resetdb example programDale Smith8 Jun
        • Re: Link errors with resetdb example programDale Smith8 Jun
          • Re: Link errors with resetdb example programChris Frey9 Jun
  • Re: Link errors with resetdb example programWarren Young9 Jun
    • Re: Link errors with resetdb example programDale Smith9 Jun
    • Re: Link errors with resetdb example programDale Smith10 Jun
      • Re: Link errors with resetdb example programWarren Young10 Jun
        • Re: Link errors with resetdb example programDale Smith10 Jun
          • Re: Link errors with resetdb example programWarren Young10 Jun
            • Re: Link errors with resetdb example programChris Frey12 Jun
              • Re: Link errors with resetdb example programDale Smith13 Jun
              • Re: Link errors with resetdb example programDale Smith13 Jun
              • Re: Link errors with resetdb example programWarren Young13 Jun
                • Re: Link errors with resetdb example programChris Frey14 Jun
                  • Re: Link errors with resetdb example programWarren Young14 Jun