[Top][All Lists]

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

Newbie: "undefined reference" error; cannot link to existing library

From: platter
Subject: Newbie: "undefined reference" error; cannot link to existing library
Date: Sun, 03 Feb 2002 14:52:37 -0600

Hello all,

Any help on this would be very much appreciated as I am completely stuck.

I am having trouble repackaging a shared library using the Automake, libtool,
and Autoconf.  I have been able to successfully build a distribution that
installs the shared library correctly, but when I try to compile a test
program that uses the library, the following error occurs:

address@hidden newsmdi]$ gcc -g -lsmdi -o test firsttest.c
/usr/local/lib/ undefined reference to `pthread_create'
collect2: ld returned 1 exit status

The shared library uses functions from the pthreads library, so I tried adding
LDADD= pthread, libsmdi_la_LTLDADD = pthread, and some other variations to
my, and none of them worked.

It seems that the shared library is being built but not properly linked to
the other libraries that it depends on.

Will someone please let me know what I need to do to portably link to an
existing library ( and listed below).

Thanks in advance for the help; I have looked through the docs and searched
the net with no luck.




## Process this file with automake to produce

libsmdi_la_SOURCES = smdi.c aspi.linux.c
libsmdi_la_LDFLAGS = -version-info 0:5:0
libsmdi_la_LTLDADD = pthread

include_HEADERS = aspi.h smdi.h


dnl Process this file with autoconf to produce a configure script.

dnl From Autoconf manual:

dnl Autoconf requirements
dnl AC_INIT(package, version, bug-report-address)
dnl information on the package
dnl checks for programs
dnl checks for libraries
dnl checks for header files
dnl checks for types
dnl checks for structures
dnl checks for compiler characteristics
dnl checks for library functions
dnl checks for system services
dnl AC_CONFIG_FILES([file...])

AM_INIT_AUTOMAKE(opensmdi, 0.0.5)
dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]