LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-23-2004, 10:53 AM   #1
jemmyw
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 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.
 
  


Reply


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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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