gcc and X
Hi
I am trying to compile a c-file with some calls to X rotines
-----------------//------------------
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include "xdriver.h"
(...)
int
init_driver(ScreenSpecs *screen_specs)
{
XEvent event;
int dummy;
XCharStruct chars;
unsigned long event_mask;
XGCValues gcv;
unsigned long mask;
key_buf_in = key_buf_out = 0;
/* open the display */
display = XOpenDisplay(NULL);
screen = DefaultScreen(display);
root = DefaultRootWindow(display);
depth = DefaultDepth(display, screen);
black = BlackPixel(display, screen);
white = WhitePixel(display, screen);
screen_specs->planes = depth;
(...)
-----------------//------------------
But when I do the command
> gcc xdriver.c
I got
-----------------//------------------
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/ccoZsSbI.o: In function `init_driver':
/tmp/ccoZsSbI.o(.text+0x23): undefined reference to `XOpenDisplay'
(...)
-----------------//------------------
What's the problem? More important what's the solution :)
Thanks
--
Pedro Quaresma de Almeida
e-mail: pedro@mat.uc.pt
Reply to: