2

What I have tried (running Tcl and Tk 8.6.0 on Windows):

load D:/toot/bar/em.dll
load "D:/toot/bar/em.dll"
load D://toot//bar//em.dll
load "D://toot//bar//em.dll"
load D:\toot\bar\em.dll
load "D:\toot\bar\em.dll"
load D:\\toot\\bar\\em.dll
load "D:\\toot\\bar\\em.dll"

All of which return one of these two errors:

couldn't load library [what I put after 'load']: invalid argument

couldn't load library [what I put after 'load', rendered]: this library or a dependent library could not be found in library path

Community
  • 1
  • 1
A T
  • 13,008
  • 21
  • 97
  • 158
  • 1
    1. Is this dll an tcl extension? 2. If yes, are all required dependencies in the path? – Johannes Kuhn Aug 11 '13 at 12:42
  • 1. yes, 2. By path, do you mean my `PATH` system environmental variable? – A T Aug 11 '13 at 12:43
  • Okay, doesn't appear to be a load syntax issue; thinking versioning problem. FYI: I am working with [Tkisem](http://www.cs.inf.ethz.ch/37-023/tkisem/download/Tkisem.zip) – A T Aug 11 '13 at 12:55

2 Answers2

1

Assuming that file exists D:/toot/bar/em.dll returns truea, load D:/toot/bar/em.dll should work. However, it sounds like you've got problems with things (i.e., other DLLs) that the library depends on.

This is a general problem on Windows that has been asked elsewhere on Stack Overflow; the answers there are relevant to this question. You should also be aware that if the DLL has been linked against a specific version of the Tcl DLL (not recommended on Windows for Tcl extensions) then you need to have the same version of Tcl installed as it was linked against. Stub-enabled extensions do not have this problem at all (though they can still run into problems with other required libraries being absent).

It's a shame that the load command doesn't tell you what DLL is missing in its error message, but IIRC the underlying OS API doesn't report it either. You're stuck with using an external tool to diagnose these things…


a Don't worry about backslash/forward-slash issues; Tcl handles those for you.

Community
  • 1
  • 1
Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
1

I have this problem, too,couldn't load library "ChariotExt": invalid argument.

And sovled it by change tcl version x64 to x86.

Brian
  • 33
  • 6