Artifacts Associated With Ticket a55872c242
Ticket change [6999bb2960] (rid 201991) by ralfixx on 2022-06-20 10:37:19:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Taking the minimal tclsh example from https://wiki.tcl-lang.org/page/Building+a+custom+tclsh /* t.c */ #include <tcl.h> int AppInit(Tcl_Interp *interp) { if(Tcl_Init(interp) == TCL_ERROR) return TCL_ERROR; Tcl_SetVar(interp,"tcl_rcFileName","~/.wishrc",TCL_GLOBAL_ONLY); return TCL_OK; } int main(int argc, char *argv[]) { Tcl_Main(argc, argv, AppInit); return 0; } /* End of file */ Linking on windows now requires linking against the TCL stubs library in 8.7, where this was not required in 8.6. This is due to a change in the Tcl_Main macro on windows, which now includes a call to Tcl_SetPanicProc(Tcl_ConsolePanic) in tcl.h: #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \ ((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp)())) where 'Tcl_ConsolePanic' is #defined NULL on Linux, but a real function on Windows, which is only available in the stubs library. Linking against 8.7: $ cl /nologo /Fet.exe t.c -Itcltk87/include tcltk87/lib/tcl87.lib t.c t.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "Tcl_ConsolePanic" in Funktion "main". t.exe : fatal error LNK1120: 1 nicht aufgelöste Externe adding tcltk87/lib/tclstub87.lib to the link line => success. $ cl /nologo /Fet.exe t.c -Itcltk87/include tcltk87/lib/tcl87.lib tcltk87/lib/tclstub87.lib t.c => success Linking against 8.6: $ cl /nologo /Fet.exe t.c -Itcltk86/include tcltk86/lib/tcl86.lib t.c => success Not sure if this was intentional, but it probably should be documented in the Tcl_Main manpage, which already reads Programs that call Tcl_Main must be linked against the standard Tcl library. - foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "ralfixx"
- priority initialized to: "5 Medium"
- private_contact initialized to: "1d3c95db24e116878d6afed7cf890a89a0effe62"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "ralfixx"
- subsystem initialized to: "69. Other"
- title initialized to:
tcl8.7 on windows: linking against stubs library is now required in 8.7
- type initialized to: "Bug"
Ticket change [939cf3e827] (rid 201992) by oehhar on 2022-06-20 10:45:25:
- icomment:
Thank you, Ralf, IMHO, this is a bug. IMHO, it should work by one of: * static build * link to tcl lib * link to tcl stubs lib As you report, the tcl lib is not sufficient. The stubs lib is required. Thank you, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [bb3744b19b] (rid 201993) by jan.nijtmans on 2022-06-20 11:29:14:
- assignee changed to: "jan.nijtmans"
- icomment:
This change is due to [https://core.tcl-lang.org/tips/doc/trunk/tip/425.md|TIP #425]. Tcl_ConsolePanic() needs to be static, because the panicproc could - theoretically - be called even after bringing down tcl.dll. The only way I see to fulfill this requirement is putting Tcl_ConsolePanic() in the stub library, then we are sure it is linked statically in the executable so it will always be available.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [efd0e3ab13] (rid 202000) by jan.nijtmans on 2022-06-20 11:58:19:
- icomment:
If the Tcl library is static, the stub library should not be necessary. That's fixed [a55872c242|here]. If the Tcl library is a dll, I don't see a solution without the stub library. So, documented that now. Ralf, can you live with that ;-)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- icomment:
Ticket change [229d1b36af] (rid 202001) by jan.nijtmans on 2022-06-20 11:59:43:
- icomment:
Fix is really [3483c7eafdebabe8|here] (previous link just links back to this ticket....)
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [cff325ddad] (rid 202002) by ralfixx on 2022-06-20 14:15:28:
- icomment: "Yes, of course I can live with that ;-)"
- login: "ralfixx"
- mimetype: "text/plain"
Ticket change [e6c0d7fce9] (rid 202013) by jan.nijtmans on 2022-06-20 15:21:30:
- closedate changed to: "2459751.13993464"
- closer changed to: "jan.nijtmans"
- icomment: "Changes committed now. Thanks!"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"