I have a library and I have generated tcl bindings for the same using swig. The dll thus generated is xyz_tcl.dll if my original lib dll us xyz.dll. but when I try to load the dll its says “invalid command name “MZ””. Can any one tell me what could be reason for it.
Share
The
MZis almost certainly the first few bytes of the DLL (it’s the “magic number” of the file format) so at a guess you’re trying to do:That won’t work. It contains compiled C code that integrates with Tcl, but not a Tcl script. Instead, you need to do:
Of course, it should be build into a package (which is a directory containing the required DLLs and a file
pkgIndex.tcl) which would then let you do something like this instead:(The
pkgIndex.tclfile contains instructions on how to define the package using the other files, throughloadandsourceas necessary.)