Skip to content
Tcl Source Code Changes To Migrating C extensions to Tcl 9
Login

Changes To Migrating C extensions to Tcl 9

Changes to "Migrating C extensions to Tcl 9" between 2024-03-16 05:18:42 and 2024-04-14 11:28:18

︙
227
228
229
230
231
232
233

234


235






236

237
238
239
240
241
242
243
244
245
246
247
248
249
250

251
252
253
254
227
228
229
230
231
232
233
234

235
236
237
238
239
240
241
242
243

244
245
246
247
248
249
250
251
252
253
254
255
256
257

258
259
260
261
262







+
-
+
+

+
+
+
+
+
+
-
+













-
+




* Extensions using the definitions of `mp_digit`, `mp_word` or `mp_int` need to include either
 `tclTomMath.h` or `tommath.h` in addition `tcl.h`.

See See [TIP 538](https://core.tcl-lang.org/tips/doc/trunk/tip/538.md).

## Building

### Building with autotools
### Error `interpreter uses an incompatible stubs mechanism`

* Update TEA to the latest [tclconfig](https://core.tcl-lang.org/tclconfig).

* Within your `configure.ac` or `configure.in` file, change the `TEA_INIT` call to require **3.13** or whatever the latest version happens to be.

* Run `autoconf` to regenerate configure.

* When running `configure`, in addition to the `--with-tcl` option also specify the `--with-tclinclude`. It's possible this is only required on MingW and seems like a [bug](https://core.tcl-lang.org/tcl/tktview/6f22c7a1fc) in TEA but I am not sufficiently versed in TEA to tell for sure.

The load command (directly or via `package require`) may raise the error 
Without those options, the load command (directly or via `package require`) may raise the error 

*interpreter uses an incompatible stubs mechanism*.

This *may* happen when building against a private Tcl 9 installation with a system installed Tcl 8 version. For example, if you do

```
% path/to/extension/configure --with-tcl=/path/to/tcl9/lib
% make
```

To resolve, also specify the `--with-tclinclude` option to `configure`.

```
% path/to/extension/configure --with-tcl=/path/to/tcl9/lib --with-tclinclude=/path/to/tcl9/include
% path/to/extension/configure --prefix=/path/to/tcl9 --with-tcl=/path/to/tcl9/lib --with-tclinclude=/path/to/tcl9/include
% make
```

See the [ticket](https://core.tcl-lang.org/tcl/tktview/6f22c7a1fc) for the specific circumstances when this may happen.