From: Mona on
On Mar 16, 1:41 pm, S...(a)ControlQ.com wrote:
> On Sun, 14 Mar 2010, Mona wrote:
> > Now, when I am building, I get the below link errors.  Any ideas how I
> > can resolve these?
>
> > rm -f tkpng09.dll
> > link -dll -nologo -lz  C:/sbx_tcl8.5.6/third_party/tcl/tcl8.5.6/win32/
> > lib
> > /tclstub85.lib C:/sbx_tcl8.5.6/third_party/tcl/tcl8.5.6/win32/lib/
> > tkstub8
> > 5.lib -release -out:tkpng09.dll tkImgPNG.obj tkImgPNGInit.obj
> > LINK : warning LNK4044: unrecognized option '/lz'; ignored
> > tkstub85.lib(tkStubLib.obj) : MSIL .netmodule or module compiled with /
>
> [snip]
>
> Always read error messages (especially from a linker) like a love letter!
>
> Note the referenced '/lz' as an unrecognized option ...
>
> '-lz' in a *nix based system implies that libz.[so|a|o] exists somewhere
> where your linker can find it.  You will need to put the libz.dll or
> whatever windows compiler will name it in a location that it can be found,
> and point your linker to it an a manner consistent with object files ...
>
> Cheers,
> Rob.

Ok, so now I have the following link line, and am linking with
zlib1.lib.

link -dll -nologo /MANIFEST -lz C:/my_sandbox/third_party/tcl/
tcl8.5.6/../../
zlib-1.2.3/shared/lib/win32d/zlib1.lib C:/my_sandbox/third_party/tcl/
tcl8.5.6/
win32d/lib/tclstub85d.lib C:/my_sandbox/third_party/tcl/tcl8.5.6/
win32d/
lib/tkstub85d.lib -debug -out:tkpng09d.dll tkImgPNG.obj
tkImgPNGInit.
Obj

It finds the built package just fine if I I do "package require tkpng"
from the
installation directory, i.e. where tkpng09.dll is at. But, when
I try to use the package from some other folder location it complains:
“couldn't load library "C:/my_sandbox/third_party/tcl/tcl8.5.6/win32d/
lib/tkpng0.9/tkpng09d.dll": this library or a dependent library could
not be found in library path.”

Does anyone have an idea how I can resolve this?

Thanks,
Mona.
From: Larry W. Virden on
On Mar 19, 7:27 am, Mona <impm...(a)yahoo.com> wrote:

> It finds the built package just fine if I I do "package require tkpng"
> from the
> installation directory, i.e. where tkpng09.dll is at.  But, when
> I try to use the package from some other folder location it complains:

In general, tcl and tk compiable extensions are distributed with the
idea that after compilation is done, one will perform some sort of
installation into a final folder. That folder is usually provided as a
configuration parameter. If the --prefix or --exec_prefix is not
provided, then defaults are used.

If you used the makefile to build the extension, then there is
probably a step of

make install

that takes care of copying files into the intended folder.
From: Mona on
> configuration parameter. If the --prefix or --exec_prefix is not
> provided, then defaults are used.
>
> If you used the makefile to build the extension, then there is
> probably a step of
>
> make install
>
> that takes care of copying files into the intended folder.

yes, i am using the --exec-prefix and --prefix to setup the
installation directory. The "make" and "make install" goes fine.
And, it is installing/copying the tkpng09 dll in "C:/my_sandbox/
third_party/tcl/tcl8.5.6/win32d/
lib/tkpng0.9". And, so when I do "package require tkpng" in this
folder through my wish console, then it loads the package just fine.
But if I am in say, "C:/my_sandbox/third_party/tcl/tcl8.5.6" or any
other folder other than where tkpng dll is, then it complains with
"couldn't load library" message.
What can be wrong?

Thanks.
From: Mona on
> installation into a final folder. That folder is usually provided as a
> configuration parameter. If the --prefix or --exec_prefix is not
> provided, then defaults are used.
>
> If you used the makefile to build the extension, then there is
> probably a step of
>
> make install
>
> that takes care of copying files into the intended folder.

Here is more info on the commands I am running the following commands:

../configure -with-tcl=$TCLDIR/win -with-tk=$TKDIR/win --prefix=$
{INSTALLDIR} --exec-prefix=${INSTALLDIR} -enable-shared -enable-
threads -enable-symbols SHELL=bash
make
make install


(where
TCLDIR=C:/my_sandbox/third_party/tcl/tcl8.5.6,
TKDIR=C:/my_sandbox/third_party/tcl/tk8.5.6
INSTALLDIR=C:/my_sandbox/third_party/tcl/tcl8.5.6/win32d
)
From: Larry W. Virden on
On Mar 19, 1:03 pm, Mona <impm...(a)yahoo.com> wrote:

> yes, i am using the --exec-prefix and --prefix to setup the
> installation directory.  The "make" and "make install" goes fine.
> And, it is installing/copying the tkpng09 dll in "C:/my_sandbox/
> third_party/tcl/tcl8.5.6/win32d/
> lib/tkpng0.9".  And, so when I do "package require tkpng" in this
> folder through my wish console, then it loads the package just fine.
> But if I am in say, "C:/my_sandbox/third_party/tcl/tcl8.5.6" or any
> other folder other than where tkpng dll is, then it complains with
> "couldn't load library" message.
> What can be wrong?

Perhaps others have better ideas. The first thought I have is that the
tclsh that you are using to run the program doesn't know about that
installation directory.

Try starting your tclsh and then type
% puts $auto_path


which should show you the places that the package require command and
other things will look for libraries.