www.digitalmars.com         C & C++   DMDScript  

c++ - Digital Mars and Fltk

reply "Karol Gottan" <gottan op.pl> writes:
Hi,

I am trying to cmpile Fltk GUI (www.fltk.org)
using DMC, but I am getting some errors.

One of them is a problem with overloaded
functions like :

-------
src\Fl_Pixmap.cxx(52) : Error: ambiguous reference to symbol
Had: fl_measure_pixmap(char *const *, int &, int &)
and: fl_measure_pixmap(char const *const *, int &, int &)
    fl_draw_pixmap(data(), 0, 0, FL_BLACK);
-------

and

-------
src\Fl_Pixmap.cxx(87) : Error: ambiguous reference to symbol
Had: fl_draw_pixmap(char *const *, int, int, int enum Fl_Color)
and: fl_draw_pixmap(char const *const *, int, int, int enum Fl_Color)
-------

Is there a quick solution for this kind of errors ?
(I am rather lammer in C++).

-- 

Karol Gottan
Jan 26 2004
parent reply "Walter" <walter digitalmars.com> writes:
"Karol Gottan" <gottan op.pl> wrote in message
news:bv2v0h$937$1 digitaldaemon.com...
 Hi,

 I am trying to cmpile Fltk GUI (www.fltk.org)
 using DMC, but I am getting some errors.

 One of them is a problem with overloaded
 functions like :

 -------
 src\Fl_Pixmap.cxx(52) : Error: ambiguous reference to symbol
 Had: fl_measure_pixmap(char *const *, int &, int &)
 and: fl_measure_pixmap(char const *const *, int &, int &)
     fl_draw_pixmap(data(), 0, 0, FL_BLACK);
 -------
Try casting the arguments to the types for the particular function you want to call.
Jan 26 2004
parent reply "Karol Gottan" <gottan op.pl> writes:
<walter digitalmars.com> wrote :
 "Karol Gottan" <gottan op.pl> wrote in message
 news:bv2v0h$937$1 digitaldaemon.com...
 Hi,

 I am trying to cmpile Fltk GUI (www.fltk.org)
 using DMC, but I am getting some errors.

 One of them is a problem with overloaded
 functions like :

 -------
 src\Fl_Pixmap.cxx(52) : Error: ambiguous reference to symbol
 Had: fl_measure_pixmap(char *const *, int &, int &)
 and: fl_measure_pixmap(char const *const *, int &, int &)
     fl_draw_pixmap(data(), 0, 0, FL_BLACK);
 -------
Try casting the arguments to the types for the particular function you want to call.
That was the first step I tried. But it does not help with DMC. Not with this overloading type : int draw( char* const* data, int x, int y); int draw(const char* const* data, int x, int y); In this case casting does not work in DMC. -- Karol
Jan 27 2004
parent reply "Walter" <walter digitalmars.com> writes:
"Karol Gottan" <gottan op.pl> wrote in message
news:bv6fn2$jo$1 digitaldaemon.com...
 <walter digitalmars.com> wrote :
 "Karol Gottan" <gottan op.pl> wrote in message
 news:bv2v0h$937$1 digitaldaemon.com...
 Hi,

 I am trying to cmpile Fltk GUI (www.fltk.org)
 using DMC, but I am getting some errors.

 One of them is a problem with overloaded
 functions like :

 -------
 src\Fl_Pixmap.cxx(52) : Error: ambiguous reference to symbol
 Had: fl_measure_pixmap(char *const *, int &, int &)
 and: fl_measure_pixmap(char const *const *, int &, int &)
     fl_draw_pixmap(data(), 0, 0, FL_BLACK);
 -------
Try casting the arguments to the types for the particular function you want to call.
That was the first step I tried. But it does not help with DMC. Not with this overloading type : int draw( char* const* data, int x, int y); int draw(const char* const* data, int x, int y); In this case casting does not work in DMC.
Can you give a complete code snippet illustrating the problem?
Jan 27 2004
parent reply "Karol Gottan" <gottan op.pl> writes:
Walter wrote:

 Can you give a complete code snippet illustrating the problem?
Something like this one : ---------------------------------------------- #include <stdio.h> class foo { public: explicit foo( char * const * D) {}; explicit foo(const char * const * D) {}; int draw( char * const * data, int x, int y); int draw(const char * const * data, int x, int y); }; int foo::draw(char * const * data, int x, int y) { return draw( (const char * const * )data, x, y ); } int foo::draw(const char * const * data, int x, int y) { return 1; } static const char *broken[] = { "16 24 4 1", NULL }; static foo bar( (const char * const * )broken ); int main(int argv, char **arvc) { bar.draw( broken, 0, 0 ); return 0; } ---------------------------------------------- -- Karol
Jan 28 2004
parent reply "Walter" <walter digitalmars.com> writes:
Ok. To work around, I suggest commenting out the declaration not needed.
Thanks, -Walter
Jan 28 2004
parent "Karol Gottan" <gottan op.pl> writes:
<walter digitalmars.com> wrote :
 Ok. To work around, I suggest commenting out the
 declaration not needed.
That's what I did. And I have to say I am after a successfull compilation of Fltk now. Works great. Many thanks. -- Karol
Jan 28 2004