Subject: Re: Can't link TclMagick anymore
From: Dave Bodenstab <[email-masked]>
To: [email-masked]
Date: Tue, 08 Aug 2006 20:25:32 -0500
Newsgroups: gmane.os.cygwin

Danny Smith wrote:
> Dave Bodenstab  wrote:
> 
>> Warning: .drectve `-defaultlib:MSVCRT ' unrecognized
>> Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
>> Cannot export ??_C@_03KBFG@Tcl?$AA@: symbol not found
>> Cannot export ??_C@_0DM@EBFE@This?5interpreter?5does?5not?5suppor@: 
>> symbol not found
>> Cannot export ^?CORE_RL_magick__NULL_THUNK_DATA: symbol not found
>> Cannot export ^?CORE_RL_wand__NULL_THUNK_DATA: symbol not found
>> collect2: ld returned 1 exit status
>>
>>
> 
> <snip>
>> + binutils 20060709-1
> 
> 
> ld now recognizes the ".lib" suffix as an import lib and it has higher
> priority than directing linking to a dll (without an import lib).
> 
> Move the the msvc-built libs  (CORE_RL_wand_.LIB? CORE_RL_magick_.LIB?) 
> out of your search path so that ld finds the .DLL files instead 
> (I suspect they are in /cygdrive/c/Program Files/ImageMagick)
> 
> (alternatively, you could try adding
> "-Wl,-no-export-libs,CORE_RL_wand_.LIB,CORE_RL_magick_.LIB" 
> or similar

That must be the problem.  Thanks.  I've gotten further, but I still
have a problem.

First of all, my background is unix... so I've been thinking .dll=.so
and .lib=.a   I guess this is probably wrong... I've ran across the
import/export lib terms but I don't know what they are  :(

I changed the -L to reference the directory where the ImageMagick .dll's
live.  But I *do* need the tclstub84.lib (which contains tclStubLib.obj 
-- there is no tclstub84.dll).
I even did 'ar x tclstub84.lib' and put the tclStubLib.obj on the
link command line.  I still get:

$ gcc -v -shared -mno-cygwin \
   -o libTclMagick.dll \
   -L'/cygdrive/c/Program Files/ImageMagick' \
   TclMagick.o \
   tclStubLib.obj \
   -lCORE_RL_wand_ -lCORE_RL_magick_
Warning: .drectve `-defaultlib:MSVCRT ' unrecognized
Warning: .drectve `-defaultlib:OLDNAMES ' unrecognized
Cannot export ??_C@_03KBFG@Tcl?$AA@: symbol not found
Cannot export ??_C@_0DM@EBFE@This?5interpreter?5does?5not?5suppor@: 
symbol not found

If I recompile so I don't need tclstub84.lib (and link against 
tcl84.dll) things work -- *but* I lose Tcl's feature that loads the
tcl dll dynamically so I don't have to re-link every time a new
release of Tcl is made available.

So... binutils has changed.

+ Is there any way to get the old behavior?  The older version
   must have been able to use tclstub84.lib and link in the .obj
   or it would not have been able to create a working .dll (since
   I never linked against Tcl's .dll's -- they're in a different
   directory)
+ Can I somehow convert the tclStubLib.obj into something that
   the new binutils can use?
+ Or do I need to abandon Cygwin for this and install yet another
   gcc from MingW?

Thanks again for the help.

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