I am using Ubuntu 8.04. I was trying some Xwindows programming (trying to learn it). First, it went well. It created a window. It detected KeyPress event ant etc. But, when I tried to interface the mouse, I received some error.
In the event loop, I tried this code:
Code:
case Expose:
ShowMousePosition(gc, win, MouseX, MouseY);
break;
case MotionNotify:
MouseX=event.xbutton.x;
MouseY=event.xbutton.y;
ShowMousePosition(gc, win, MouseX, MouseY);
break;
When I complied the program, I got these errors:
Quote:
test.cpp: In function ‘int main()’:
test.cpp:66: error: ‘gc’ was not declared in this scope
test.cpp:66: error: ‘ShowMousePosition’ was not declared in this scope
|
I am following a text book. So, I wrote exactly the same codes the book has shown me.
What is the problem actually?
Is there any other packages I have to install?