Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
January 26, 2004 Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
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
|
January 26, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karol Gottan | "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. |
January 27, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | <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
|
January 28, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karol Gottan | "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? |
January 28, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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", "@ c #000000", NULL }; static foo bar( (const char * const * )broken ); int main(int argv, char **arvc) { bar.draw( broken, 0, 0 ); return 0; } ---------------------------------------------- -- Karol |
January 28, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Karol Gottan | Ok. To work around, I suggest commenting out the declaration not needed. Thanks, -Walter |
January 28, 2004 Re: Digital Mars and Fltk | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | <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
|
Copyright © 1999-2021 by the D Language Foundation