|
From: Donald G P. <dg...@ni...> - 2008-12-12 20:05:13
|
Donald G Porter wrote:
> $ gcc demo.c -L... -l tcl8.5 -l tkstub8.5
Due to the changes surrounding tclStubsPtr in 8.6, the corresponding
build line:
$ gcc demo.c -L... -l tcl8.6 -l tkstub8.6
.../libtkstub8.6.a(tkStubLib.o): In function `Tk_InitStubs':
tkStubLib.c:(.text+0x16): undefined reference to `tclStubsPtr'
tkStubLib.c:(.text+0xfb): undefined reference to `tclStubsPtr'
tkStubLib.c:(.text+0x136): undefined reference to `tclStubsPtr'
tkStubLib.c:(.text+0x174): undefined reference to `tclStubsPtr'
collect2: ld returned 1 exit status
Following revised copy works for all branches:
#undef USE_TCL_STUBS
#include "tcl.h"
#define USE_TK_STUBS
#include "tk.h"
int appInitProc(Tcl_Interp *interp) {
return TCL_OK;
}
int main(int argc, char **argv) {
Tcl_Interp *interp = Tcl_CreateInterp();
if (Tcl_Init(interp) == TCL_ERROR) {
Tcl_Panic("borked Tcl install!");
}
#undef Tcl_InitStubs
if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
Tcl_Panic("Cannot init Tcl stubs!");
}
if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
Tcl_Panic("Cannot find Tk!");
}
Tk_MainEx(argc, argv, appInitProc, interp);
}
The #undef in the middle is less than pretty, and Daniel
Steffen and I have been chatting about how that might be
improved. May have developments on that during the beta
cycle.
--
| Don Porter Mathematical and Computational Sciences Division |
| don...@ni... Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
|