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

Re: Compiling simple Motif/Lesstif programs.

On Tue, Nov 24, 1998 at 03:10:44 -0800, Christopher R. Barry wrote:
> bash-2.01$ cc -o foo foo.c -I/usr/X11R6/include
> /tmp/ccc06235: In function `main':
> /tmp/ccc06235(.text+0x1f): undefined reference to `XtInitialize'
> /tmp/ccc06235(.text+0x44): undefined reference to `_XmStrings'
> /tmp/ccc06235(.text+0x49): undefined reference to `_XmStrings'
> [rest snipped]
> I'm pretty sure I'm missing some linker flags, but -lX11, -lXm and
> others give me: ld: cannot open -lX11:  No such file or directory

The linker doesn't look in the directory that has the X11 libraries by
default. You need to add -L/usr/X11R6/lib to your link line.

J.H.M. Dassen                 | RUMOUR  Believe all you hear. Your world may  
jdassen@wi.LeidenUniv.nl      | not be a better one than the one the blocks   
                              | live in but it'll be a sight more vivid.      
                              |     - The Hipcrime Vocab by Chad C. Mulligan  

Reply to: