• Re: cannot find -ltcl84

    From Rich@21:1/5 to Roderick on Wed Dec 15 18:12:44 2021
    Roderick <hruodr@gmail.com> wrote:

    I am trying to compile tcl8.4 on Freebsd 11.4. I get the following
    error:

    gcc -O -pipe -DTCL_DBGX= tclAppInit.o -L/usr/opt/tcl84/src/tcl/unix -ltcl84 -lm -Wl,-rpath,/usr/opt/tcl84/lib -o tclsh
    /usr/local/bin/ld: cannot find -ltcl84
    collect2: error: ld returned 1 exit status
    *** Error code 1

    The library is there:

    # ls libtcl84.so.1
    libtcl84.so.1

    Any hint?

    Where is "there" (i.e., path to libtcl84* files?

    You may need to add that path as a -L option to the compile line.
    Which might entail using a --with-libtcl=/.../.../ option (or something similar, "configure --help" to see the options) to configure.

    Configure ignores the variable CC. If I do

    ./configure --prefix=/usr/opt/tcl84 CC=cc

    it still use gcc.

    I'll have to let someone else answer this one.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to All on Wed Dec 15 17:51:37 2021
    I am trying to compile tcl8.4 on Freebsd 11.4. I get the following
    error:

    gcc -O -pipe -DTCL_DBGX= tclAppInit.o -L/usr/opt/tcl84/src/tcl/unix
    -ltcl84 -lm -Wl,-rpath,/usr/opt/tcl84/lib -o tclsh
    /usr/local/bin/ld: cannot find -ltcl84
    collect2: error: ld returned 1 exit status
    *** Error code 1

    The library is there:

    # ls libtcl84.so.1
    libtcl84.so.1

    Any hint?

    Configure ignores the variable CC. If I do

    ./configure --prefix=/usr/opt/tcl84 CC=cc

    it still use gcc.

    Thanks
    Rod.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Rich on Wed Dec 15 18:37:27 2021
    On Wed, 15 Dec 2021, Rich wrote:

    Roderick <hruodr@gmail.com> wrote:

    I am trying to compile tcl8.4 on Freebsd 11.4. I get the following
    error:

    gcc -O -pipe -DTCL_DBGX= tclAppInit.o -L/usr/opt/tcl84/src/tcl/unix
    -ltcl84 -lm -Wl,-rpath,/usr/opt/tcl84/lib -o tclsh
    /usr/local/bin/ld: cannot find -ltcl84
    collect2: error: ld returned 1 exit status
    *** Error code 1

    The library is there:

    # ls libtcl84.so.1
    libtcl84.so.1

    Any hint?

    Where is "there" (i.e., path to libtcl84* files?

    You may need to add that path as a -L option to the compile line.
    Which might entail using a --with-libtcl=/.../.../ option (or something similar, "configure --help" to see the options) to configure.

    You see -L/usr/opt/tcl84/src/tcl/unix in the failed gcc command
    above. And there, namely in /usr/opt/tcl84/src/tcl/unix, is
    the file libtcl84.so.1. It was compiled before with the same
    make command.

    Rod.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Roderick on Wed Dec 15 19:12:25 2021
    Roderick <hruodr@gmail.com> wrote:

    On Wed, 15 Dec 2021, Rich wrote:

    Roderick <hruodr@gmail.com> wrote:

    I am trying to compile tcl8.4 on Freebsd 11.4. I get the following
    error:

    gcc -O -pipe -DTCL_DBGX= tclAppInit.o -L/usr/opt/tcl84/src/tcl/unix
    -ltcl84 -lm -Wl,-rpath,/usr/opt/tcl84/lib -o tclsh
    /usr/local/bin/ld: cannot find -ltcl84
    collect2: error: ld returned 1 exit status
    *** Error code 1

    The library is there:

    # ls libtcl84.so.1
    libtcl84.so.1

    Any hint?

    Where is "there" (i.e., path to libtcl84* files?

    You may need to add that path as a -L option to the compile line.
    Which might entail using a --with-libtcl=/.../.../ option (or something
    similar, "configure --help" to see the options) to configure.

    You see -L/usr/opt/tcl84/src/tcl/unix in the failed gcc command
    above. And there, namely in /usr/opt/tcl84/src/tcl/unix, is
    the file libtcl84.so.1. It was compiled before with the same
    make command.

    Do you also have a symlink from libtcl84.so to libtcl84.so.1 in the
    same directory (i.e. like bellow, except this is for 8.6):

    /usr/lib64/libtcl.so -> libtcl8.6.so*
    /usr/lib64/libtcl8.6.so*
    /usr/lib64/libtclstub8.6.a*

    The linker (at least GNU's linker on Linux) does not look for the *.1
    files, it looks for the *.so files. If the *.1 lib is still in the
    source dir (rather than having been installed) then the symlink from
    the *.so to the actual file may not yet exist (the symlinks are often
    created when the shared object file is installed).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Roderick on Wed Dec 15 19:31:17 2021
    Roderick <hruodr@gmail.com> wrote:

    On Wed, 15 Dec 2021, Rich wrote:

    Do you also have a symlink from libtcl84.so to libtcl84.so.1 in the
    same directory (i.e. like bellow, except this is for 8.6):

    Thanks, Rich!

    This worked. I compiled tcl84 before. I do not remember having it done before. Perhaps something changed in the system.

    Normally the 'compile' generates the versioned file (*.1 *.2 etc.) but
    does not (usually under Linux...) create the symlink from the plain
    (*.so) file to the versioned file (*.1, etc.).

    The symlink, at least for Linux and the GNU toolset, is created when
    the lib is installed into its install directory.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Rich on Wed Dec 15 19:21:29 2021
    On Wed, 15 Dec 2021, Rich wrote:

    Do you also have a symlink from libtcl84.so to libtcl84.so.1 in the
    same directory (i.e. like bellow, except this is for 8.6):

    Thanks, Rich!

    This worked. I compiled tcl84 before. I do not remember having it done
    before. Perhaps something changed in the system.

    Rod.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Rich on Wed Dec 15 20:31:28 2021
    On Wed, 15 Dec 2021, Rich wrote:

    Normally the 'compile' generates the versioned file (*.1 *.2 etc.) but
    does not (usually under Linux...) create the symlink from the plain
    (*.so) file to the versioned file (*.1, etc.).

    The symlink, at least for Linux and the GNU toolset, is created when
    the lib is installed into its install directory.

    Thanks again. I am compiled things that I compiled many times before.
    But now are so dificult only for such kind f things.

    It is libtcl84.so.1, but sometimes is needed libtcl84.so, sometimes libtcl8.4.so

    Now I am having a problem with metakit. But that in other post.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Thu Dec 16 11:46:57 2021
    * Roderick <hruodr@gmail.com>
    | It is libtcl84.so.1, but sometimes is needed libtcl84.so, sometimes
    | libtcl8.4.so

    The compile-time linker (typically ld, the one invoked by the compiler
    to create the program) always requires the .so, either directly or via
    symlink.

    The runtime-linker (typically ld.so, the one which makes the program
    using the library run) require either the .so or the versioned .so.1,
    depending on whether the library was built with versioning info (option -soname=name for ld) or not.

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Thu Dec 16 11:38:58 2021
    * Roderick <hruodr@gmail.com>
    | Configure ignores the variable CC. If I do

    | ./configure --prefix=/usr/opt/tcl84 CC=cc

    | it still use gcc.

    Try

    CC=cc ./configure --prefix=/usr/opt/tcl84

    (if you're not in bash or some other shell where you can set environment
    vars like this, use
    env CC=cc ./configure --prefix=/usr/opt/tcl84
    )

    If all fails, just edit the CC variable in the generated Makefile(s),
    or call

    make CC=cc ...

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roderick@21:1/5 to Ralf Fassel on Thu Dec 16 11:34:31 2021
    Thanks for the concise info. I keep it in mind for the next time.


    On Thu, 16 Dec 2021, Ralf Fassel wrote:

    * Roderick <hruodr@gmail.com>
    | It is libtcl84.so.1, but sometimes is needed libtcl84.so, sometimes
    | libtcl8.4.so

    The compile-time linker (typically ld, the one invoked by the compiler
    to create the program) always requires the .so, either directly or via symlink.

    The runtime-linker (typically ld.so, the one which makes the program
    using the library run) require either the .so or the versioned .so.1, depending on whether the library was built with versioning info (option -soname=name for ld) or not.

    HTH
    R'


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)