Ticket Change Details
Not logged in
Overview

Artifact ID: 6999bb29603ef7ed7ece6a3c8b550c723b099d71e3c7818435a4e52d68b34b05
Ticket: a55872c2429bea123139d3f2bd25182a2d6c78f7
tcl8.7 on windows: linking against stubs library is now required in 8.7
User & Date: ralfixx 2022-06-20 10:37:19
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed 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.
    
  5. foundin changed to: "8.7"
  6. is_private changed to: "0"
  7. login: "ralfixx"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "1d3c95db24e116878d6afed7cf890a89a0effe62"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "ralfixx"
  14. subsystem changed to: "69. Other"
  15. title changed to:
    tcl8.7 on windows: linking against stubs library is now required in 8.7
    
  16. type changed to: "Bug"