Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-23-2004, 10:53 AM   #1
LQ Newbie
Registered: Mar 2004
Posts: 1

Rep: Reputation: 0
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 This is how the relevant parts of look currently:

dnl check for X11

and the


switcheroolibdir = $(prefix)/lib/switcheroo
switcheroolib_LTLIBRARIES =

libswitch_la_SOURCES = \
atoms.c \
tasklist.c \
switch.c \
atoms.h \
defs.h \
globals.h \
switch.h \

libswitch_la_CFLAGS = \

libswitch_la_LIBADD = \

but when i run make i get the message:

/bin/sh ../libtool --mode=link gcc -g -O2 -o -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/ -Wl,-soname -Wl, -o .libs/ cannot find -lSM
collect2: ld returned 1 exit status
make: *** [] 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 file to make it work.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how install xlibs headers? lord_didger Linux - Software 2 08-19-2005 11:12 AM
installation of xlibs-dev rohr Debian 4 01-21-2005 02:26 AM
howto get Xlibs to display pixmap? SciYro Programming 0 07-31-2004 07:11 AM
xlibs and libxrender problem.... rebelcan Debian 3 02-20-2004 04:30 PM
where to get xlibs-dev package for redhat 8? kinghari Linux - Newbie 0 10-16-2003 12:15 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration