www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - tkd - basic compilation problem

reply "Paul" <paul example.com> writes:
I downloaded the archive from 
https://github.com/nomad-software/tkd and files are same as in 
the git repo. Tcl/tk is installed on this machine (test 'hello 
world' script works fine) but I get this error when compiling the 
example from the github page:

tkd/interpreter/tcl.d(16): Error: module tcl is in file 
'tcltk/tcl.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import

As far as I can see there is no tcltk directory - can someone 
tell me where I'm going wrong or if something is missing?

TIA

Paul
Jun 30 2015
next sibling parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Tuesday, 30 June 2015 at 12:58:21 UTC, Paul wrote:
 I downloaded the archive from 
 https://github.com/nomad-software/tkd and files are same as in 
 the git repo. Tcl/tk is installed on this machine (test 'hello 
 world' script works fine) but I get this error when compiling 
 the example from the github page:

 tkd/interpreter/tcl.d(16): Error: module tcl is in file 
 'tcltk/tcl.d' which cannot be read
 import path[0] = /usr/include/dmd/phobos
 import path[1] = /usr/include/dmd/druntime/import

 As far as I can see there is no tcltk directory - can someone 
 tell me where I'm going wrong or if something is missing?

 TIA

 Paul
AFAICS tkd requires too additional libraries (bindings): tcltk and x11. Its easiest to use DUB for building, it will download all required dependencies and pass the correct import paths to the compiler. The following works for me: dub.json: { "name": "tkd-test-app", "dependencies": { "tkd": "~>1.1.4" } } source/app.d: (the example program) Running "dub" successfully builds and executes the example program.
Jun 30 2015
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
If you don't want to use DUB, you need to download the other two 
packages from code.dlang.org and specifiy "-I/path/to/tcltk 
-I/path/to/x11 -I/path/to/tkd" in the DMD invocation.
Jun 30 2015
parent reply "Paul" <paul example.com> writes:
On Tuesday, 30 June 2015 at 13:19:25 UTC, Marc Schütz wrote:
 If you don't want to use DUB, you need to download the other 
 two packages from code.dlang.org and specifiy "-I/path/to/tcltk 
 -I/path/to/x11 -I/path/to/tkd" in the DMD invocation.
Thank you, I'll try that.
Jun 30 2015
parent reply "Paul" <paul example.com> writes:
On Tuesday, 30 June 2015 at 13:22:43 UTC, Paul wrote:
 On Tuesday, 30 June 2015 at 13:19:25 UTC, Marc Schütz wrote:
 If you don't want to use DUB, you need to download the other 
 two packages from code.dlang.org and specifiy 
 "-I/path/to/tcltk -I/path/to/x11 -I/path/to/tkd" in the DMD 
 invocation.
Thank you, I'll try that.
Added info: I wanted to avoid using dub so I could manually figure out what would be required to distribute the application.
Jun 30 2015
parent reply "Paul" <paul example.com> writes:
Using dub I get this during linking:

Building tkd-test ~master configuration "application", build type 
debug.
Compiling using dmd...
Linking...
/usr/bin/ld: cannot find -ltcl
/usr/bin/ld: cannot find -ltk

...any suggestions please?
Jun 30 2015
next sibling parent reply "Alex Parrill" <initrd.gz gmail.com> writes:
On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build 
 type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
You need to install the libraries. Ex `sudo apt-get install libtcl8.5 libtk8.5`
Jun 30 2015
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Tuesday, 30 June 2015 at 15:25:27 UTC, Alex Parrill wrote:
 On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build 
 type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
You need to install the libraries. Ex `sudo apt-get install libtcl8.5 libtk8.5`
Or the corresponding -dev packages.
Jun 30 2015
parent reply "Paul" <paul example.com> writes:
On Tuesday, 30 June 2015 at 16:06:41 UTC, Marc Schütz wrote:
 On Tuesday, 30 June 2015 at 15:25:27 UTC, Alex Parrill wrote:
 On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build 
 type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
You need to install the libraries. Ex `sudo apt-get install libtcl8.5 libtk8.5`
Or the corresponding -dev packages.
Hmmm, I have libtcl8.6 and libtk8.6 installed already. The only dev packages I see are tclcl and tclap - I can't find any libtk -dev package. I was hoping to keep a tight rein on what was required to be installed to simplify deployment but its spiraling out of control again LOL.
Jul 01 2015
parent reply "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm gmx.net> writes:
On Wednesday, 1 July 2015 at 07:37:48 UTC, Paul wrote:
 On Tuesday, 30 June 2015 at 16:06:41 UTC, Marc Schütz wrote:
 On Tuesday, 30 June 2015 at 15:25:27 UTC, Alex Parrill wrote:
 On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build 
 type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
You need to install the libraries. Ex `sudo apt-get install libtcl8.5 libtk8.5`
Or the corresponding -dev packages.
Hmmm, I have libtcl8.6 and libtk8.6 installed already. The only dev packages I see are tclcl and tclap - I can't find any libtk -dev package.
Someone more familiar with Debian/Ubuntu than me may be able to help you here, sorry.
 I was hoping to keep a tight rein on what was required to be 
 installed to simplify deployment but its spiraling out of 
 control again LOL.
The -dev packages are only required during development (specifically at link time), the resulting binary only needs the normal packages installed.
Jul 01 2015
parent "Paul" <paul example.com> writes:
On Wednesday, 1 July 2015 at 09:38:05 UTC, Marc Schütz wrote:
 Someone more familiar with Debian/Ubuntu than me may be able to 
 help you here, sorry.

 I was hoping to keep a tight rein on what was required to be 
 installed to simplify deployment but its spiraling out of 
 control again LOL.
The -dev packages are only required during development (specifically at link time), the resulting binary only needs the normal packages installed.
Thanks Marc, I found the required packages... it threw me because they don't have any version number in the repo ... and the example works just fine now.
Jul 01 2015
prev sibling parent reply Jordi Sayol via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
El 30/06/15 a les 16:28, Paul via Digitalmars-d-learn ha escrit:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
If you are in Debian, Ubuntu, Linuxmint, etc, you can use the d-apt repository: http://d-apt.sourceforge.net/ There are deb packages for tkd: $ sudo apt-get install libtkd-dev libtkd-doc You can compile the example application included on libtkd-doc deb package to test if "tkd" is properly installed on your system: For shared linking against libphobos2.so and libtkd.so: $ dmd `pkg-config --cflags --libs tkd` -J/usr/share/libtkd-doc/example/media/ /usr/share/libtkd-doc/example/example.d For static linking against libphobos2.a and libtkd.a: $ dmd `pkg-config --cflags --libs tkd-static` -J/usr/share/libtkd-doc/example/media/ /usr/share/libtkd-doc/example/example.d Best regards, Jordi
Jul 01 2015
parent "Paul" <paul example.com> writes:
On Wednesday, 1 July 2015 at 18:38:27 UTC, Jordi Sayol wrote:

 For shared linking against libphobos2.so and libtkd.so:
 $ dmd `pkg-config --cflags --libs tkd` 
 -J/usr/share/libtkd-doc/example/media/ 
 /usr/share/libtkd-doc/example/example.d

 For static linking against libphobos2.a and libtkd.a:
 $ dmd `pkg-config --cflags --libs tkd-static` 
 -J/usr/share/libtkd-doc/example/media/ 
 /usr/share/libtkd-doc/example/example.d
Thank you Jordi, I've got everything installed ok now but those linking instructions might come in very handy!
Jul 01 2015
prev sibling next sibling parent reply "Gary Willoughby" <dev nomad.so> writes:
On Tuesday, 30 June 2015 at 12:58:21 UTC, Paul wrote:
 ...
I really don't understand posts like this when literally all information needed is in the README file: https://github.com/nomad-software/tkd Just read RTFM.
Jul 01 2015
parent "Paul" <paul example.com> writes:
On Wednesday, 1 July 2015 at 17:43:11 UTC, Gary Willoughby wrote:
 On Tuesday, 30 June 2015 at 12:58:21 UTC, Paul wrote:
 ...
I really don't understand posts like this when literally all information needed is in the README file: https://github.com/nomad-software/tkd Just read RTFM.
I read that before posting, specifically the parts that say: "Tkd requires version 8.6 (or greater) of the Tcl/Tk libraries installed. A small exception is when creating a self-contained installation on Windows. See details below. Tcl/Tk itself requires the x11 libraries installed on Linux only." and "On Linux and Mac OSX things are a little easier as both operating systems have Tcl/Tk installed by default. If however they do not have the latest version, the libraries can be updated via their respective package managers. The linked libraries are libtcl and libtk." I can't see how they answer the questions I've asked (which admittedly are more related to the distro that D per se).
Jul 01 2015
prev sibling parent reply "Gary Willoughby" <dev nomad.so> writes:
On Wednesday, 1 July 2015 at 19:45:04 UTC, Paul wrote:
 I can't see how they answer the questions I've asked.
Let me see. On Tuesday, 30 June 2015 at 12:58:21 UTC, Paul wrote:
 I downloaded the archive from 
 https://github.com/nomad-software/tkd and files are same as in 
 the git repo. Tcl/tk is installed on this machine (test 'hello 
 world' script works fine) but I get this error when compiling 
 the example from the github page:

 tkd/interpreter/tcl.d(16): Error: module tcl is in file 
 'tcltk/tcl.d' which cannot be read
 import path[0] = /usr/include/dmd/phobos
 import path[1] = /usr/include/dmd/druntime/import

 As far as I can see there is no tcltk directory - can someone 
 tell me where I'm going wrong or if something is missing?
The following text is taken from: https://github.com/nomad-software/tkd#source-code Tkd requires other D source libraries to correctly use and link against pre-existing C libraries. The source dependencies are as follows: * https://github.com/nomad-software/tcltk * https://github.com/nomad-software/x11 Dub handles these automatically and during a build acquires them. While building, the tcltk repository is configured to link against the required Tcl/Tk libraries, hence they need to be installed for the application to function. On Tuesday, 30 June 2015 at 14:28:49 UTC, Paul wrote:
 Using dub I get this during linking:

 Building tkd-test ~master configuration "application", build 
 type debug.
 Compiling using dmd...
 Linking...
 /usr/bin/ld: cannot find -ltcl
 /usr/bin/ld: cannot find -ltk

 ...any suggestions please?
The following text is taken from: https://github.com/nomad-software/tkd#libraries Tkd requires version 8.6 (or greater) of the Tcl/Tk libraries installed. A small exception is when creating a self-contained installation on Windows. See details below. Tcl/Tk itself requires the x11 libraries installed on Linux only. On Wednesday, 1 July 2015 at 07:37:48 UTC, Paul wrote:
 Hmmm, I have libtcl8.6 and libtk8.6 installed already. The only 
 dev packages I see are tclcl and tclap - I can't find any libtk 
 -dev package.

 I was hoping to keep a tight rein on what was required to be 
 installed to simplify deployment but its spiraling out of 
 control again LOL.
The following text is taken from: https://github.com/nomad-software/tkd#building * It's recommended to use the dub build tool to build all Tkd projects. On Wednesday, 1 July 2015 at 12:40:31 UTC, Paul wrote:
 Thanks Marc, I found the required packages... it threw me 
 because they don't have any version number in the repo ... and 
 the example works just
The following text is taken from: https://github.com/nomad-software/tkd#libraries Tkd requires version 8.6 (or greater) of the Tcl/Tk libraries installed. A small exception is when creating a self-contained installation on Windows. See details below. Tcl/Tk itself requires the x11 libraries installed on Linux only. ---- This is exactly why you use dub, so you don't have to worry about all this!
Jul 02 2015
parent reply "Paul" <paul example.com> writes:
On Thursday, 2 July 2015 at 17:41:45 UTC, Gary Willoughby wrote:
 This is exactly why you use dub, so you don't have to worry 
 about all this!
You're right, there's sufficient information there if using dub.
Jul 02 2015
parent "Gary Willoughby" <dev nomad.so> writes:
On Thursday, 2 July 2015 at 18:34:13 UTC, Paul wrote:
 On Thursday, 2 July 2015 at 17:41:45 UTC, Gary Willoughby wrote:
 This is exactly why you use dub, so you don't have to worry 
 about all this!
You're right, there's sufficient information there if using dub.
Please read that page again.
Jul 02 2015