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.
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.
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.
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.
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):
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.
* 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'
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 26:13:27 |
Calls: | 6,448 |
Files: | 12,050 |
Messages: | 5,254,426 |