public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: not quite polymorphism
@ 2010-11-02 19:54 eric lin
  2010-11-02 21:39 ` Andrew Bell
  0 siblings, 1 reply; 4+ messages in thread
From: eric lin @ 2010-11-02 19:54 UTC (permalink / raw)
  To: gcc; +Cc: gcc-help


Dear gcc/g++ programers:

that is in the book "Programming-Principle and practice using C++" 4th Ed., Chapter 12, display model
I can not compile first example chapter.12.3
                 or simplest    chapter.12.7.2
by fltk 1.1.10 or 1.3 or 2.0
they all show name ambiguous "Window", since it be declared in X11 's header file
under my gcc/g++ 4.4.3
linux
that I am glad to hear anyone have succesful story on linux/gcc.  If it is , please specify detail platform 
the example code, and included graphic header/source file can be got form Mr. Bjarne Stroustrup's website

    http://www.stroustrup.com/Programming/Programming-code2.zip

it comewith's fltk 1.1.9 is not Make able.  Fltk forum programers suggest using 1.1.10, 1.3, 2.0 to install and compile
I suggest rather than critize newcomer/newuser's question is unripen, advancer should show out the real successful code which can compile and run.  If not, please contact directly with orignal author of the code, who even is creator of c++.
  I ever email him, this problem and point out some of his code's (last)variable("own") be assigned as Window (struct),  how/where it be used(I didn't find how and where), so c++ compiler may dissolve same name but multi-usage variables (polymophism) problem.  But so far i still waiting.  I certain have no problem to go touch source of gcc by myself, just hope to see more programers feedback on this same issue with me.

Eric



_____________________________________________________________
Luxmail.com is spam free. However, we do not throw your important emails into spam box like other defective email systems.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: not quite polymorphism
  2010-11-02 19:54 not quite polymorphism eric lin
@ 2010-11-02 21:39 ` Andrew Bell
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Bell @ 2010-11-02 21:39 UTC (permalink / raw)
  To: fsshl; +Cc: gcc, gcc-help

On Tue, Nov 2, 2010 at 2:46 PM, eric lin <fsshl@luxmail.com> wrote:
>
> Dear gcc/g++ programers:
>
> that is in the book "Programming-Principle and practice using C++" 4th Ed., Chapter 12, display model
> I can not compile first example chapter.12.3
>                 or simplest    chapter.12.7.2
> by fltk 1.1.10 or 1.3 or 2.0

...deleted...

Eric,

It is difficult to understand your English.  This group is just to
discuss issues that are specific to the gcc compiler and it is likely
that your issue is more general.  I suggest you make a simple example
that exhibits the problem you are having and post on another group
(comp.lang.c++.moderated, perhaps).

Best,

-- 
Andrew Bell
andrew.bell.ia@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: not quite polymorphism
  2010-11-02  3:35 eric lin
@ 2010-11-02  5:01 ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2010-11-02  5:01 UTC (permalink / raw)
  To: fsshl; +Cc: gcc

"eric lin" <fsshl@luxmail.com> writes:

> I am using 4.4.3, could anyone have experience to use different(newer)
> version of gcc/g++ so it can distinquish different useage of same
> variable, i.e. Window, in my case without response by compile time
> error?

This question is not appropriate for the mailing list gcc@gcc.gnu.org,
which is for issues regarding the development of gcc itself.  It would
be appropriate for the mailing list gcc-help@gcc.gnu.org.  Please take
any followups to gcc-help.  Thanks.

Unfortunately I don't know the answer to your question, as you did not
provide any source code.  In the absence of other information it appears
to be a language question rather than a compiler question.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* not quite polymorphism
@ 2010-11-02  3:35 eric lin
  2010-11-02  5:01 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: eric lin @ 2010-11-02  3:35 UTC (permalink / raw)
  To: gcc

/usr/include/c++/4.4/backward/backward_warning.h:28:2: warning:
#warning This file includes at least one deprecated or antiquated
header which may be removed without further notice at a future date.
Please use a non-deprecated interface with equivalent functionality
instead. For a listing of replacement headers and interfaces, consult
the  file  backward_warning.h.  To  disable  this  warning  use
-Wno-deprecated.
In file included from Simple_window.cpp:7:
Simple_window.h:17: error: reference to ‘Window’ is ambiguous
/usr/include/X11/X.h:96: error: candidates are: typedef XID Window
Window.h:26: error:                 class Graph_lib::Window
Simple_window.h:17: error: reference to ‘Window’ is ambiguous
/usr/include/X11/X.h:96: error: candidates are: typedef XID Window
Window.h:26: error:                 class Graph_lib::Window
Simple_window.cpp: In constructor
‘Simple_window::Simple_window(Point, int, int, const String&)’:
Simple_window.cpp:12: error: reference to ‘Window’ is ambiguous
/usr/include/X11/X.h:96: error: candidates are: typedef XID Window
Window.h:26: error:                 class Graph_lib::Window
Simple_window.cpp:12: error: class ‘Simple_window’ does not have any
field named ‘Window’
Simple_window.cpp:16: error: ‘attach’ was not declared in this scope
Simple_window.cpp:      In      member      function      ‘bool
Simple_window::wait_for_button()’:
Simple_window.cpp:26: error: ‘show’ was not declared in this scope
Simple_window.cpp: In member function ‘void Simple_window::next()’:
Simple_window.cpp:53: error: ‘hide’ was not declared in this scope
# cc1plus 0.54 0.04
make[1]: *** [Simple_window.o] Error 1
rm Graph.o GUI.o
make[1]: Leaving directory `/home/eric/BStrou/usingC++4/code/GUI'
make: *** [../GUI/libbookgui.a] Error 2
eric@eric-laptop:~/BStrou/usingC++4/code/Chapter12$
-------------------------------------------------------------------------link fltk with example program of book by Stroustrup------
I am using 4.4.3, could anyone have experience to use different(newer) version of gcc/g++ so it can distinquish different useage of same variable, i.e. Window, in my case without response by compile time error?

thans your time and effort a lot in advance, Eric


_____________________________________________________________
Luxmail.com is spam free. However, we do not throw your important emails into spam box like other defective email systems.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-02 19:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 19:54 not quite polymorphism eric lin
2010-11-02 21:39 ` Andrew Bell
  -- strict thread matches above, loose matches on Subject: below --
2010-11-02  3:35 eric lin
2010-11-02  5:01 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).