Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Requesting for any Tcl/Tk source code example for compiling practice

165 views
Skip to first unread message

thesh...@gmail.com

unread,
Apr 28, 2015, 6:33:03 AM4/28/15
to
To the community

I am a newbie trying my hand in programming and I have chosen Tcl/Tk as my first language.

I have bought and read the book "Practical programming in Tcl and Tk" and while definitely not a master, I have managed to write a few small codes for a simple app using Tk for my graphics and Tcl for my processes.

I have spent the day attempting to compile a Tcl/Tk application and have been getting nothing but errors.

I have been following the steps with Tclkit found on http://wiki.tcl.tk/11861
and have been getting critical errors with a screen's worth of sentences.

I want to accomplish making a stand-alone exe (for the sense of success) and from there start various little projects hone my abilities.
I am asking for a source code that is working and ready to be compiled via the steps explained in the site above.

Thanks so much in advance

Sincerely
Shikiria

Arjen Markus

unread,
Apr 28, 2015, 6:53:15 AM4/28/15
to
Op dinsdag 28 april 2015 12:33:03 UTC+2 schreef Kevin Shiki Tang:
Can you tell us what these errors are?

In my experience (but I have more of that than you) it is simple:
- tclkit sdx.kit qwrap myprogram.tcl --> gives a file "myprogram.kit"
- tclkit sdx.kit unwrap myprogram.kit --> this allows you to add extra source '
files that your program may require
- tclkit sdx.kit wrap myprogram.kit (for a starkit)
or:
- tclkit sdx.kit wrap myrprogram.exe -runtime tclkit2.exe (for a starpack)

Of course, if your application requires platform-dependent extensions, things get more complex, but for a simple program the above should work.

Regards,

Arjen

Robert Heller

unread,
Apr 28, 2015, 7:02:29 AM4/28/15
to
Have a look at the Model Railroad System
(http://www.deepsoft.com/home/products/modelrailroadsystem/). I do that all
the time with great success.

>
> Thanks so much in advance
>
> Sincerely
> Shikiria
>

--
Robert Heller -- 978-544-6933
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
hel...@deepsoft.com -- Webhosting Services

Rich

unread,
Apr 28, 2015, 11:31:38 AM4/28/15
to
thesh...@gmail.com wrote:
> To the community

> I am a newbie trying my hand in programming and I have chosen Tcl/Tk
> as my first language.

Welcome.

> I have spent the day attempting to compile a Tcl/Tk application and
> have been getting nothing but errors.

> I have been following the steps with Tclkit found on
> http://wiki.tcl.tk/11861 and have been getting critical errors with a
> screen's worth of sentences.

A sample of those error messages would have proven to have been
immensely helpful to us in diagnosing what may be going wrong.
Otherwise the only advice we can offer is you have to follow the
instructions on that page _exactly_. Those instructions work, but if
you deviate (without understanding what is going on) you will get error
messages.

> I want to accomplish making a stand-alone exe (for the sense of
> success) and from there start various little projects hone my
> abilities. I am asking for a source code that is working and ready to
> be compiled via the steps explained in the site above.

Any Tcl source will work with those instructions, provided the
instructions are properly followed. Somewhere there is a subtle
deviation from the instructions on that page, and with nothing more
than a report of "it does not work" we can not be of much help here on
the other side of Usenet.

Kevin Shiki Tang

unread,
Apr 29, 2015, 1:40:55 AM4/29/15
to
Thanks for the reply

My error code is as such.

file open failed
while executing
"mk::file open mk4vfs3 {c:/Users/user/Desktop/New
Project/Better.exe}"
("eval" body line 1)
invoked from within
"eval [list mk::file open $db $file] $args"
(procedure "::mk4vfs::_mount" line9)
invoked from within
"::mk4vfs::_mount {C:Users/user/Desktop/New Project/Better.exe}"
("eval" body line 1)
invoked from within
"eval [list ::mk4vfs::_mount $mkfile] $args"
(procedure "vfs::mk4::Mount" line 15)
invoked from within
"vfs::mk4:;Mount $out $out"
(file "C:users/user/Desktop/New
Project/sdx.kit/lib/app-sdx/wrap.tcl" line 273)
invoked from within
"source {C:/Users/user/Desktop/New
Project/sdx.kit/lib/app-sdx/wrap.tcl}"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source [file join $b $a.tcl]]"
(procedure "run_sdx" line 17)
invoked from within
"run_sdx"
(file "C:/users/user/Desktop/New Project/sdx.kit/lib/app-sdx/sdx.tcl" line 59)
invoked from within
"source {C:/Users/user/Desktop/New Project/sdx.kit/lib/app-sdx/sdx.tcl}"
("package if needed app-sdx 2.0" script)
invoked from within
"package require app-sdx"
(file "C:/Users/user/Desktop/New Project/sdx.kit/main.tcl" line 8)
invoked from within
"source [C:Users/user/Desktop/new project/sdx.kit/main.tcl}"
("uplevel" body line 1)
invoked from within
"uplevel [list source [file join $self main.tcl]]"

Arjen Markus

unread,
Apr 29, 2015, 3:19:53 AM4/29/15
to
Op woensdag 29 april 2015 07:40:55 UTC+2 schreef Kevin Shiki Tang:
Well, that looks menacing indeed :), but the crux is in the first line: does the file "Better.exe" exist on your machine (in the directory
c:/Users/user/Desktop/New Project/) and if so, is it readable?

Regards,

Arjen

Kevin Shiki Tang

unread,
Apr 29, 2015, 4:40:08 AM4/29/15
to
Yes it is in the folder

What I dont understand is that I use freewrap exe to change my .tcl files into exe it works like a charm.

I am near certain I must have messed up my cmd I will try again later

thanks for your help Arjen!

Arjen Markus

unread,
Apr 29, 2015, 4:45:38 AM4/29/15
to
Op woensdag 29 april 2015 10:40:08 UTC+2 schreef Kevin Shiki Tang:
Hm, could it be that you use the program better.exe both as the command to run and as the runtime? That is, something like:

better.exe sdx.kit wrap myprogram -runtime better.exe

That will not work because of some odd limitation in Windows. That is why we always copy the runtime to a new name, unimaginatively something like better2.exe

Regards,

Arjen

Rich

unread,
Apr 29, 2015, 6:05:24 AM4/29/15
to
Arjen Markus <arjen.m...@gmail.com> wrote:
> Op woensdag 29 april 2015 10:40:08 UTC+2 schreef Kevin Shiki Tang:
> > On Wednesday, 29 April 2015 15:19:53 UTC+8, Arjen Markus wrote:
> > > Op woensdag 29 april 2015 07:40:55 UTC+2 schreef Kevin Shiki Tang:
> > > > Thanks for the reply
> > > >
> > > > My error code is as such.
> > > >
> > > > file open failed
> > > > while executing
> > > > "mk::file open mk4vfs3 {c:/Users/user/Desktop/New
> > > > Project/Better.exe}"
> > > > ("eval" body line 1)
> > > > invoked from within
> > > > "eval [list mk::file open $db $file] $args"
> > > > (procedure "::mk4vfs::_mount" line9)
> > > > invoked from within
> > > > ...
> > >
> > > Well, that looks menacing indeed :), but the crux is in the first
> > > line: does the file "Better.exe" exist on your machine (in the
> > > directory c:/Users/user/Desktop/New Project/) and if so, is it
> > > readable?
> >
> > Yes it is in the folder
> >
> > What I dont understand is that I use freewrap exe to change my .tcl
> > files into exe it works like a charm.
> >
> > I am near certain I must have messed up my cmd I will try again later
> >
> > thanks for your help Arjen!

> Hm, could it be that you use the program better.exe both as the
> command to run and as the runtime? That is, something like:

> better.exe sdx.kit wrap myprogram -runtime better.exe

> That will not work because of some odd limitation in Windows. That is
> why we always copy the runtime to a new name, unimaginatively
> something like better2.exe

Note, it is helpful to have:
1) the command you were attempting to run
and
2) the resulting error message

Because sometimes the error message (as in this case) is likely caused
by you providing the command the incorrect options. I agree with
Arjen, this looks like the error message you get when you skip this
step from the Wiki:

Step 2

Make a copy of the tclkit.exe into the directory where your TCL source
code file is. Ex: in c:\Birds. Rename it to tclkit2.exe.

---> You will now have in c:\Birds the following files:

* Birds.tcl
* tclkit.exe
* tclkit2.exe
* sdx.kit

Also, is "Better.exe" a tclkit, just named a different name than
"tclkit"?

Robert Heller

unread,
Apr 29, 2015, 7:37:11 AM4/29/15
to

Did you do something like a 'strip' of the exe file after making the starpack?

Kevin Shiki Tang

unread,
Apr 30, 2015, 3:10:00 AM4/30/15
to
Greetings

No I definitely have the items in my folder correct.
Better.exe I assume is the exe generated from my tcl script : Better.tcl
with regards to tclkit I think it's a version 8.6.x something along those lines (I deleted the numbers just to save myself from typing 3 more characters) Would that have an effect?

Sincerely
Shiki

Kevin Shiki Tang

unread,
Apr 30, 2015, 3:10:55 AM4/30/15
to
What is a "strip"?

Sincerely
Shiki

Arjen Markus

unread,
Apr 30, 2015, 4:22:55 AM4/30/15
to
Op donderdag 30 april 2015 09:10:00 UTC+2 schreef Kevin Shiki Tang:

>
> No I definitely have the items in my folder correct.
> Better.exe I assume is the exe generated from my tcl script : Better.tcl
> with regards to tclkit I think it's a version 8.6.x something along those lines (I deleted the numbers just to save myself from typing 3 more characters) Would that have an effect?
>
> Sincerely
> Shiki

Can you post the exact command line? From your description I am guessing that you use "-runtime Better.exe", but that would be an incorrect use of that option. The "-runtime" option specifies which tclkit to use to turn the starkit into a starpack. You can make a starpack on Windows that should run on OSX for instance by specifying a tclkit that runs on that platform.

Once you have the starpack, you can rename it to whatever you like. But the building process assumes that the directory myprogram.vfs is to be used for the starkit myprogram.kit and the starpack myprogram.exe (replace "myprogram" by the name of your program)

Regards,

Arjen

Arjen Markus

unread,
Apr 30, 2015, 4:24:21 AM4/30/15
to
Op donderdag 30 april 2015 09:10:55 UTC+2 schreef Kevin Shiki Tang:

>
> What is a "strip"?
>
> Sincerely
> Shiki

strip is a utility that is used to strip the visible names out of an executable program. That is mostly used for security reasons, IIUIC.

Regards,

Arjen

Rich

unread,
Apr 30, 2015, 6:04:52 AM4/30/15
to
Kevin Shiki Tang <thesh...@gmail.com> wrote:
> No I definitely have the items in my folder correct.

This statement.

> Better.exe I _assume_ is the exe generated from my tcl script

And this statement are opposite. If you _assume_ something is the exe
generated from your script, then you, yourself, are not sure. If you
are not sure, there is absolutely no way we can know this with any
certianty on the other side of Usenet.

This is why we asked for the commands you ran, to eventually get this
error message. You have to give us the information we need to be able
to help you.

You should read these two essays:

How to Report Bugs Effectively
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

How To Ask Questions The Smart Way
http://www.catb.org/esr/faqs/smart-questions.html

They will explain better than what I have time to type right now why we
ask for the information we do. It is _essential_ to us being able to
give you assistance.

Robert Heller

unread,
Apr 30, 2015, 9:15:27 AM4/30/15
to
It also removes debugging information and is also used to reduce the size of
the executable program. Generally, strip removes all the unneeded (by normal,
eg production, use) bits.

>
> Regards,
>
> Arjen

Robert Heller

unread,
Apr 30, 2015, 9:15:27 AM4/30/15
to
It is a UNIX/Linux utility commonly applied to executables (and shared
libraries) to strip off debug info to make them smaller, generally by removing
'extra' 'sections' from these files. I discovered that the RPM building
process does this and when done to a UNIX/Linux StarPack, it effectively
strips off the VFS tacked only the end of the StarPack reducing the StarPack
to only the prefix exe file, with all of the application code missing...

>
> Sincerely
> Shiki
0 new messages