This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libtool issue on shared lib


marco atzeri skrev 2012-03-23 12:05:
> I am trying to adapt socketxx to cygwin
> (http://www.linuxhacker.at/socketxx)
> 
> In addition to a lot of other problems, I have a puzzling libtool issue
> 
> 
> make[2]: Entering directory `/pub/devel/gdcm/socket++-1.12.13_build/socket++'
> /bin/sh ../libtool --tag=CXX    --mode=link g++   -Wall -g -O2 -version-info 1:2:0  -o libsocket++.la -rpath /usr/local/lib sockstream.lo sockinet.lo sockunix.lo  pipestream.lo fork.lo protocol.lo echo.lo smtp.lo ftp.lo  sig.lo
> libtool: link: warning: undefined symbols not allowed in i686-pc-cygwin shared libraries
> 
> but
> 
> g++   -Wall -g -O2 -shared  -o cygsocket++-0.dll -Wl,--out-implib=libsocket++.dll.a sockstream.o sockinet.o sockunix.o pipestream.o fork.o protocol.o echo.o smtp.o ftp.o  sig.o
> Creating library file: libsocket++.dll.a
> 
> $ cygcheck ./cygsocket++-0.dll
> E:\cygwin\pub\devel\gdcm\socket++-1.12.13_build\socket++\cygsocket++-0.dll
>   E:\cygwin\bin\cygwin1.dll
> [cut]
>   E:\cygwin\bin\cyggcc_s-1.dll
>   E:\cygwin\bin\cygstdc++-6.dll
> 
> 
> So where is the undefined symbol ??

Libtool want's the package to declare that it does not have any
undefined symbols.  But if this package does have undefined
symbols in it, then it can't be build (easily) on Cygwin.

> I am already using "autoreconf -f -i" and the libtool
> seems equivalent to what is working for any other package
> 
> adding LT_INIT([dlopen win32-dll shared])
> to configure.in had no effect
> 
> and the  Makefile.am is very basic
> ---------------------------------------------
> INCLUDES = -I$(top_srcdir) -I$(top_builddir)
> 
> lib_LTLIBRARIES = libsocket++.la
> libsocket___la_SOURCES = sockstream.cpp sockstream.h \
>         sockinet.cpp sockinet.h \
>         sockunix.cpp sockunix.h\
>         pipestream.cpp pipestream.h \
>         fork.cpp fork.h \
>         protocol.cpp protocol.h \
>         echo.cpp echo.h \
>         smtp.cpp smtp.h \
>         ftp.cpp ftp.h \
>         sig.cpp sig.h
> 
> libsocketincludedir=$(includedir)/socket++
> libsocketinclude_HEADERS = \
>         sockstream.h \
>         sockinet.h \
>         sockunix.h\
>         pipestream.h \
>         fork.h \
>         protocol.h \
>         echo.h \
>         smtp.h \
>         ftp.h \
>         sig.h
> libsocket___la_LDFLAGS = -version-info @LIBSOCKET_SO_VERSION@
> -------------------------------------------------
> 
> Any idea about what I should look for ?

You can try to feed -no-undefined to libtool when it links, telling
libtool that the library does not have any undefined symbols,
libtool will then at least try to create a DLL.  I would add it
to libsocket___la_LDFLAGS.

Cheers,
Peter


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]