link to xlibs
I'm writing a small C library as part of a C# program. The library is to perform the function of getting the list of open windows from the X server. I'm not a C developer, but the library code should work fine as I used another tutorial to write it, but how do I link to xlibs using configure.in. This is how the relevant parts of configure.in look currently:
dnl check for X11
BM_LIBX11_REQUIRE
BM_LIBXPM_REQUIRE
and the Makefile.am:
INCLUDES = \
@INCLTDL@ \
$(X_CFLAGS) \
$(GLIB_CFLAGS)
switcheroolibdir = $(prefix)/lib/switcheroo
switcheroolib_LTLIBRARIES = libswitch.la
libswitch_la_SOURCES = \
atoms.c \
tasklist.c \
switch.c \
atoms.h \
defs.h \
globals.h \
switch.h \
tasklist.h
libswitch_la_CFLAGS = \
@LIBX11_CFLAGS@
libswitch_la_LIBADD = \
@LIBX11_LIBS@ \
$(GLIB_LIBS)
but when i run make i get the message:
/bin/sh ../libtool --mode=link gcc -g -O2 -o libswitch.la -rpath /usr/local/lib/switcheroo atoms.lo tasklist.lo switch.lo -lSM -lICE -lX11 -lglib-2.0
gcc -shared .libs/atoms.o .libs/tasklist.o .libs/switch.o -lSM -lICE -lX11 /usr/lib/libglib-2.0.so -Wl,-soname -Wl,libswitch.so.0 -o .libs/libswitch.so.0.0.0/usr/bin/ld: cannot find -lSM
collect2: ld returned 1 exit status
make: *** [libswitch.la] Error 1
I think the problem is that there is a missing part of the linking statement, something like -L/usr/X11R6/include but I don't know how to modify the configure.in file to make it work.
|