[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc and X



On Mon, Dec 02, 2002 at 12:26:37PM +0000, Pedro Quaresma de Almeida wrote:
> 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'

Indeed, you don't have a main(). If this is a driver rather than a
program, perhaps you want to compile it as a shared object?

> /tmp/ccoZsSbI.o: In function `init_driver':
> /tmp/ccoZsSbI.o(.text+0x23): undefined reference to `XOpenDisplay'

You need to link the X library using -lX11.

Try:

  gcc -shared xdriver.c -lX11 -o xdriver.so

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: