Re: Gtk-- canvas & plot widgets



Hello friends,

>I have put a preliminary version of a Gtk_Plot widget up on my home page,
>to go along with the Gtk_Canvas widget that I wrote to this list about
>yesterday.
...
>Enjoy,
>-Jon Trowbridge

As I'm trying to get deeper into drawing programs with gtk (or better gtk--),
I've downloaded your Canvas and Plot-widget. It seems it compiles only
with egcs, which took a whole day to compile and install and then it didn't
find some libraries. So now I'm trying to make the Widgets work with gcc.

Unfortunately I'm not able to find out how to use the stack and set templates
they have in the g++/includes directory. they seem to be different from
the invocations in your files. So I've just changed the stack in
gtk--canvas.{cc,h} in an array (it's an ugly hack, I know), but I can't find
out how to use the set template.

So here I put the compiler output:

g++ -c -g  -o gtk--plot.o gtk--plot.cc
In file included from gtk--plot.cc:24:
gtk--plot.h:142: incorrect number of parameters (1, should be 2)
/usr/include/g++/set.h:27: in template expansion for decl `template <class Key,
class Compare> class set'
gtk--plot.h:142: variable or field `const_iterator' declared void
gtk--plot.h:142: confused by earlier errors, bailing out
make: *** [gtk--plot.o] Error 1 

So it seems that set needs two parameters in the declaration.

The offending line is:
 typedef set<AxisMark>::const_iterator const_iterator;
    const_iterator begin() const { return marks_.begin(); }
    const_iterator end() const { return marks_.end(); } 

And set.h says:

template <class Key, class Compare>
class set {
public:
// typedefs:

    typedef Key key_type;
    typedef Key value_type;
    typedef Compare key_compare;
    typedef Compare value_compare;
...

So now I wonder if this declaration is wrong or doesn't comply to some standard,
or else what kind of thing is "Compare"?

Maybe you or someone else knows more about these template things and why they
make problems with gcc2.7.2...

Thank you for reading all this,

          happy coding,
             
            Oliver
       



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]