This is the example from chapter 25 of the Goat Book. I typed it by hand first. When 
it didn't work, I downloaded the example files to a clean directory & tried again. 

It works in static mode ("./configure --disable-shared"), but not in dynamic mode.

I'm running the following versions:
Cygwin - 1.3.1
Automake - 1.4
Libtool - 1.4
Autoconf - 2.13
Make - 3.79.1
gcc - 2.95.3-4 (cygwin special)

$ ./config.guess
i686-pc-cygwin

$ ./configure
loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for working const... (cached) yes
checking for Cygwin environment... (cached) yes
checking for mingw32 environment... (cached) no
checking how to run the C preprocessor... (cached) gcc -E
checking host system type... i686-pc-cygwin
checking build system type... i686-pc-cygwin
checking for ld used by GCC... (cached) /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
checking for /usr/bin/ld option to reload object files... (cached) -r
checking for BSD-compatible nm... (cached) /usr/bin/nm -B
checking whether ln -s works... (cached) yes
checking how to recognise dependant libraries... (cached) file_magic file format 
pei*-i386(.*architecture: i386)?
checking for object suffix... (cached) o
checking for executable suffix... (cached) .exe
checking command to parse /usr/bin/nm -B output... (cached) ok
checking for dlfcn.h... (cached) yes
checking for ranlib... (cached) ranlib
checking for strip... (cached) strip
checking for dlltool... (cached) dlltool
checking for as... (cached) as
checking for objdump... (cached) objdump
checking if libtool should supply DllMain function... (cached) no
checking for objdir... .libs
checking for gcc option to produce PIC... (cached)   -DDLL_EXPORT
checking if gcc PIC flag   -DDLL_EXPORT works... (cached) yes
checking if gcc static flag -static works... (cached) yes
checking if gcc supports -c -o file.o... (cached) yes
checking if gcc supports -c -o file.lo... (cached) 
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking whether the linker (/usr/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... Win32 ld.exe
checking if libtool supports shared libraries... yes
creating libtool
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h
config.h is unchanged

$ make
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -c h
ello.c
mkdir .libs
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wp,-MD,.deps/hello.pp -c hello.c    -DDL
L_EXPORT -DPIC -o .libs/hello.lo
gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wp,-MD,.deps/hello.pp -c hello.c -o hell
o.o >/dev/null 2>&1
mv -f .libs/hello.lo hello.lo
/bin/sh ./libtool --mode=link gcc  -g -O2  -o libhello.la -rpath /usr/local/lib
-no-undefined -version-info 0:0:0 hello.lo
rm -fr .libs/libhello.la .libs/libhello.* .libs/libhello.*
generating symbol list for `libhello.la'
 dlltool --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_
noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 --output-def .libs/
cyghello-0.dll-def  hello.lo
 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < .libs/cyghello-0.dll
-def > .libs/libhello.exp
if test "x`head -1 .libs/libhello.exp`" = xEXPORTS; then cp .libs/libhello.exp .
libs/cyghello-0.dll-def; else echo EXPORTS > .libs/cyghello-0.dll-def; _lt_hint=
1; cat .libs/libhello.exp | while read symbol; do set dummy $symbol; case $# in
2) echo " $2 @ $_lt_hint ; " >> .libs/cyghello-0.dll-def;; *) echo " $2 @ $_lt_h
int $3 ; " >> .libs/cyghello-0.dll-def;; esac; _lt_hint=`expr 1 + $_lt_hint`; do
ne; fi
 gcc -Wl,--base-file,.libs/cyghello-0.dll-base -Wl,--dll -nostartfiles -Wl,-e,__
cygwin_dll_entry@12 -o .libs/cyghello-0.dll  hello.lo
 dlltool --as=as --dllname cyghello-0.dll --exclude-symbols DllMain@12,_cygwin_d
ll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
 --def .libs/cyghello-0.dll-def --base-file .libs/cyghello-0.dll-base --output-e
xp .libs/cyghello-0.dll-exp
 gcc -Wl,--base-file,.libs/cyghello-0.dll-base .libs/cyghello-0.dll-exp -Wl,--dl
l -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o .libs/cyghello-0.dll  hello.lo

 dlltool --as=as --dllname cyghello-0.dll --exclude-symbols DllMain@12,_cygwin_d
ll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
 --def .libs/cyghello-0.dll-def --base-file .libs/cyghello-0.dll-base --output-e
xp .libs/cyghello-0.dll-exp --output-lib .libs/libhello.dll.a
 gcc .libs/cyghello-0.dll-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@
12 -o .libs/cyghello-0.dll  hello.lo
ar cru .libs/libhello.a  hello.o
ranlib .libs/libhello.a
creating libhello.la
(cd .libs && rm -f libhello.la && ln -s ../libhello.la libhello.la)
gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -DLIBHELLO_DLL_IMPORT -c main.c
/bin/sh ./libtool --mode=link gcc  -g -O2  -o hello.exe  main.o libhello.la
generating import library for `cyghello-0.dll'
dlltool --as=as --dllname cyghello-0.dll --def .libs/cyghello-0.dll-def --output
-lib .libs/libimp-cyghello-0.a
gcc -g -O2 -o .libs/hello.exe main.o  .libs/libimp-cyghello-0.a -Wl,--rpath -Wl,
/usr/local/lib
main.o: In function `main':
/home/dcarter/cygwin-1.0/main.c:12: undefined reference to `greet'
collect2: ld returned 1 exit status
make: *** [hello.exe] Error 1

Any suggestions?

Thanks,
David Carter
[EMAIL PROTECTED]

_____________________________________________________

Get your name as your email and web site address. 
http://www.NetIdentity.com. Be somebody online.

_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool

Reply via email to