libtool
[Top][All Lists]
Advanced

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

DLL problem


From: Lars Stavholm
Subject: DLL problem
Date: Thu, 8 Mar 2001 22:09:56 +0100 (MET)

I have a bit of a problem creating a DLL that depends on a second DLL on the
MS Windows 98 platform. I'm using all the latest versions of the GNU autotools
(libtool, automake, and autoconf) with the cygwin environment. I've read the
(excellent) GNU Autotools book, and I've read the manuals, but...

It seems that libtool is not recognizing the second DLL (ossapi), i.e. the one
my library (encdec) is dependent on, as a shared library, decides to drop the
dependency, and then try to link the encdec DLL anyway. That, of course,
didn't work. The result is an error message stating undefined symbols that
should have been found in the second DLL (ossapi).

I have a static version of the ossapi library (ossapi.lib), and my encdec
library links fine with that one.

I have a feeling that I'm missing something crucial here, so any help would be
appreciated.

c:/ossasn1/win32.tgt/5.2.0/bin contains the DLL version of the ossapi and
c:/ossasn1/win32.tgt/5.2.0/lib contains the LIB version of the ossapi.

Here's an excerpt from the make log after all the C source code files have
successfully been compiled into object files:

--- Begin Included Message ---
> /bin/sh ./libtool --mode=link gcc  -g -O2 -Lc:/ossasn1/win32.tgt/5.2.0/bin -o 
> libencdec.la -rpath /home/stava/proj/nbap_alcap/encdec/lib -no-undefined 
> -release 6.1C decoder_main.lo decoder_translate.lo decoder_util.lo 
> encoder_encode_1.lo encoder_encode_2.lo encoder_get.lo encoder_main.lo 
> encoder_manage.lo encoder_util.lo nbap.lo nbap_decode.lo nbap_encode.lo  
> -lossapi -lcygwin -lcygwin 
rm -fr .libs/libencdec.la .libs/libencdec.* .libs/libencdec-6.1C.*

*** Warning: This library needs some functionality provided by -lossapi.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.
generating symbol list for `libencdec.la'
test -f .libs/libencdec-6-1C.dll-ltdll.c || sed -e "/^# \/\* ltdll\.c starts 
here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < ./libtool > 
.libs/libencdec-6-1C.dll-ltdll.c
 test -f .libs/libencdec-6-1C.dll-ltdll.o || (cd .libs && gcc -c 
libencdec-6-1C.dll-ltdll.c)
 dlltool --export-all --exclude-symbols 
address@hidden,address@hidden,address@hidden --output-def 
.libs/libencdec-6-1C.dll-def .libs/libencdec-6-1C.dll-ltdll.o  decoder_main.o 
decoder_translate.o decoder_util.o encoder_encode_1.o encoder_encode_2.o 
encoder_get.o encoder_main.o encoder_manage.o encoder_util.o nbap.o 
nbap_decode.o nbap_encode.o  
 sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < 
.libs/libencdec-6-1C.dll-def > .libs/libencdec.exp
echo EXPORTS > .libs/libencdec-6-1C.dll-def
 _lt_hint=1; cat .libs/libencdec.exp | while read symbol; do set dummy $symbol; 
case $# in 2) echo " $2 @ $_lt_hint ; " >> .libs/libencdec-6-1C.dll-def;; *) 
echo " $2 @ $_lt_hint $3 ; " >> .libs/libencdec-6-1C.dll-def;; esac; 
_lt_hint=`expr 1 + $_lt_hint`; done
 test -f .libs/libencdec-6-1C.dll-ltdll.c || sed -e "/^# \/\* ltdll\.c starts 
here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < ./libtool > 
.libs/libencdec-6-1C.dll-ltdll.c
 test -f .libs/libencdec-6-1C.dll-ltdll.o || (cd .libs && gcc -c 
libencdec-6-1C.dll-ltdll.c)
 gcc -Wl,--base-file,.libs/libencdec-6-1C.dll-base -Wl,--dll -nostartfiles 
-Wl,-e,address@hidden -o .libs/libencdec-6-1C.dll 
.libs/libencdec-6-1C.dll-ltdll.o  decoder_main.o decoder_translate.o 
decoder_util.o encoder_encode_1.o encoder_encode_2.o encoder_get.o 
encoder_main.o encoder_manage.o encoder_util.o nbap.o nbap_decode.o 
nbap_encode.o   -Lc:/ossasn1/win32.tgt/5.2.0/bin -lcygwin -lcygwin 
encoder_util.o(.text+0x5d): undefined reference to ossinit8'
encoder_util.o(.text+0x6e): undefined reference to ossSetFlags8'
encoder_util.o(.text+0x13f): undefined reference to ossOpenTraceFile8'
encoder_util.o(.text+0x150): undefined reference to ossPrint'
encoder_util.o(.text+0x168): undefined reference to ossPrintPDU12'
encoder_util.o(.text+0x17b): undefined reference to ossMarkObj12'
encoder_util.o(.text+0x1bb): undefined reference to ossEncode16'
encoder_util.o(.text+0x1da): undefined reference to ossGetErrMsg4'
encoder_util.o(.text+0x1ec): undefined reference to ossPrint'
encoder_util.o(.text+0x21c): undefined reference to ossCloseTraceFile4'
encoder_util.o(.text+0x228): undefined reference to ossCloseEncoderOutputFile4
'
encoder_util.o(.text+0x265): undefined reference to ossterm4'
nbap.o(.text+0x2e1b): undefined reference to ossLinkPer4'
nbap.o(.text+0x2e21): undefined reference to ossLinkConstraint4'
nbap.o(.text+0x2e2f): undefined reference to ossInitObjectSetInfo8'
nbap.o(.text+0x68e7f): undefined reference to ossInitRootContext8'
nbap_decode.o(.text+0x74): undefined reference to ossinit8'
nbap_decode.o(.text+0x7f): undefined reference to ossSetFlags8'
nbap_decode.o(.text+0x9c): undefined reference to ossOpenTraceFile8'
nbap_decode.o(.text+0xac): undefined reference to ossMarkObj12'
nbap_decode.o(.text+0xf0): undefined reference to ossDecode16'
nbap_decode.o(.text+0x100): undefined reference to ossGetErrMsg4'
nbap_decode.o(.text+0x10c): undefined reference to ossPrint'
nbap_decode.o(.text+0x12f): undefined reference to ossPrint'
nbap_decode.o(.text+0x146): undefined reference to ossPrintPDU12'
nbap_decode.o(.text+0xb5c): undefined reference to ossCloseTraceFile4'
nbap_decode.o(.text+0xb76): undefined reference to ossFreePDU12'
nbap_decode.o(.text+0xb7f): undefined reference to ossterm4'
collect2: ld returned 1 exit status
make: *** libencdec.la Error 1
--- End Included Message ---

And here, of course, it stops. Without really knowing what I'm doing, I take the
last statement, replacing the -L...ossasn1... (that's the second DLL, ossapi,
that my library, encdec, is depending on) reference to the directory with DLLs
with a reference to the same libraries in static archive version (LIBs), and
then it works: my libencdec.dll is created:

-- Begin Included Message ---
> gcc -Wl,--base-file,.libs/libencdec-6-1C.dll-base -Wl,--dll -nostartfiles 
> -Wl,-e,__cygwin_dll_entry12 -Lc:/ossasn1/win32.tgt/5.2.0/lib -o 
> .libs/libencdec-6-1C.dll .libs/libencdec-6-1C.dll-ltdll.o  decoder_main.o 
> decoder_translate.o decoder_util.o encoder_encode_1.o encoder_encode_2.o 
> encoder_get.o encoder_main.o encoder_manage.o encoder_util.o nbap.o 
> nbap_decode.o nbap_encode.o -lossapi -lcygwin
> ls -l .libs/*.dll
-rwxr-xr-x   1 stava    544       1937565 Mar  8 21:48 .libs/libencdec-6-1C.dll
--- End Included Message ---

Is there any way to accomplish a link with the ossapi.dll in this case?

/Lars Stavholm (address@hidden)



reply via email to

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