Re: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- From: Donald G Porter <dgp@xxxxxxxx>
- Date: Wed, 30 Apr 2008 09:38:07 -0400
Olaf Dietrich wrote:
I find the following inconsistent(?) behavior of a self-written....
Tcl package with the line
Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1)
* compiled under Tcl 8.5, I can't load the package; the error
message is:
'version conflict for package "Tcl": have 8.5.1, need exactly 8.5'
[package provide Tcl] now records full patchlevel information, so
asking for an "exact" match is a considerably more strict (and
considerably less useful) demand than it used to be. You should
at least consider relaxing your demands by changing the 1 to a 0.
> ... How could
I make my Tcl extension be loadable under all patchlevels
of a given Tcl version (but *not* under a different minor
or major version)?
Replace the Tcl_PkgRequire() call above with:
Tcl_InitStubs(interp, TCL_VERSION, 1);
And yes, I know about Tcl_InitStubs() etc. but I would like to
provide an alternative indedpendent of the stubs mechanism.
Not to worry. The Tcl_InitStubs() calls doesn't actually do anything
with stubs unless you compile with the -DUSE_TCL_STUBS directive.
Without -DUSE_TCL_STUBS, the Tcl_InitStubs() call is a macro that expands
into the right routine (Tcl_PkgRequire() in 8.4, Tcl_PkgInitStubsCheck()
in 8.5) to bridge the source incompatibility you've encountered.
With that revision, your source code will once again be able to compile
into working code against both 8.4 and 8.5 headers. (and earlier and later).
--
| Don Porter Mathematical and Computational Sciences Division |
| donald.porter@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.
- Follow-Ups:
- Re: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- From: Olaf Dietrich
- Re: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- References:
- version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- From: Olaf Dietrich
- version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- Prev by Date: load fails to load a .so file on Solaris/Sparc with Tcl 8.5Hi
- Next by Date: VC++ compiler error
- Previous by thread: Re: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- Next by thread: Re: version conflict for package "Tcl": TCL_VERSION vs TCL_PATCH_LEVEL
- Index(es):
Relevant Pages
|