Skip to content
Tcl Source Code History Of Ticket 8419b6d9ae1cfc61
Login

History Of Ticket 8419b6d9ae1cfc61

Artifacts Associated With Ticket 8419b6d9ae1cfc61

  1. Ticket change [13ff484bc9] (rid 133530) by anonymous on 2013-08-29 16:34:14:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      For windows, tclDecls.h undefines tcl_FindExecutable and redefines it only if UNICODE is defined.   Therefore dynamic linking fails on non-UNICODE apps because of the undefined call.
      
      I was attempting to compile VIM7.4 with tcl dynamically linked, but it failed.  I successfully compiled it by statically linking tcl.  
      
      Windows 7, 64 bit, mingw64 compiler using source code from master branch of tcl repo.
      
    5. is_private initialized to: "0"
    6. login: "anonymous"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Minor"
    10. status initialized to: "Open"
    11. submitter initialized to: "anonymous"
    12. subsystem initialized to: "40. Dynamic Loading"
    13. title initialized to: "Dynamic linking requres unicode on windows"
    14. type initialized to: "Bug"
  2. Ticket change [d4f3bca714] (rid 133565) by dgp on 2013-08-30 17:15:13:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Passing on to nijtmans, who I think is behind the changes.
      
      If the OP reads this, please clarify what release of Tcl
      (or checkin snapshot) you are trying to build.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. severity changed to: "Critical"
  3. Ticket change [f099cd7ea6] (rid 133570) by anonymous on 2013-08-30 20:37:28:

    1. icomment:
      Regarding request for which snapshot:   Here is the info from fossil: 
      
      project-code: 1ec9da4c469c29f4717e2a967fe6b916d9c8c06e
      checkout:     608930382ff3d2acdfdefa87a99ddb01ac63495b 2013-08-24 09:42:43 UTC
      parent:       af7ffdb548b4a5e6cf7049119c08571bf3c851fb 2013-08-23 16:23:47 UTC
      merged-into:  219c73f7e8373b7c25c0af595b92e899fca1eb8e 2013-08-26 18:32:55 UTC
      tags:         trunk
      comment:      Unbreak doc; the apropos index entry *must* be one line. (This
                    is an external constraint forced by the requirement to fit into
                    the standard Unix manual system.) (user: dkf)
      checkins:     16451
      
      I'm not very familiar with fossil usage. So post again if more info is needed.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  4. Ticket change [3fc082765b] (rid 133604) by jan.nijtmans on 2013-09-01 22:07:12:

    1. icomment:
      What's the error-message when linking? Is it a missing tclStubsPtr symbol? If so, then the problem is that you compiled your application with -DUSE_TCL_STUBS, but the tclStubPtr symbol was removed from the shared library. It works when statically linking, probably because you linked with the stub library which has this symbol.
      
      This has no relation with -DUNICODE, for Unicode applications this wouldn't work either.
      
      Solution: compile your application without -DUSE_TCL_STUBS.
      
      >Passing on to nijtmans, who I think is behind the changes.
      
      No I'm not in this case..... It's the removal of tclStubsPtr
      from the shared library which causes this change compared to 8.5
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  5. Ticket change [f71b7e9513] (rid 133608) by jan.nijtmans on 2013-09-02 13:12:15:

    1. foundin changed to: "current: 8.6.0"
    2. icomment:
      Let's take a minimal example:
      
      <pre>
      #include <tcl.h>
      void main(int argc, const char *argv[]){
        Tcl_FindExecutable(argv[0]);
        printf("OK\n");
      }
      </pre>
      
      Then (from a Cygwin or MSys shell):
      <pre>
      $ i686-w64-mingw32-gcc -o main.exe main.c -I/Tcl/include -DUNICODE -D_UNICODE -L/Tcl/lib -ltcl86
      $ ./main.exe
      OK
      $ i686-w64-mingw32-gcc -o main.exe main.c -I/Tcl/include -L/Tcl/lib -ltcl86
      $ ./main.exe
      OK
      </pre>
      
      Using -DUSE_TCL_STUBS has exactly the same result, for Tcl_FindExecutable
      that doesn't make any difference (for other functions it does)
      
      Sorry, I cannot reproduce this problem.
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. resolution changed to: "Works For Me"
    6. status changed to: "Pending"
  6. Ticket change [c5377e696b] (rid 133609) by jan.nijtmans on 2013-09-02 13:35:11:

    1. login: "jan.nijtmans"
    2. mimetype: "text/plain"
    3. subsystem changed to: "50. Embedding Support"
  7. Ticket change [a469faf727] (rid 133626) by dgp on 2013-09-03 12:40:58:

    1. icomment:
      Thank you nijtmans for the demonstrations.
      
      One detail I notice is that the ticket was opened
      complaining about building with mingw64 and your
      demos appear to be with mingw32 (or I just don't
      know how to decode the names).  Any chance that
      could matter?
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  8. Ticket change [961dd4c2c3] (rid 133658) by anonymous on 2013-09-03 21:53:06:

    1. icomment:
      When compiling/linking, the only error I received was:
      objx86-64/if_tcl.o:if_tcl.c:(.text+0x2edd): undefined reference to `Tcl_FindExecutable'
      
      The relevant part of the compile was: 
      -Id:/tools/tcl/include -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"tcl
      86.dll\" -DUSE_TCL_STUBS ...   -Ld:/tools/tcl/lib -ltclstub86
      
      In tclDecls.h, this function is undefined on WIN32 when UNICODE is not defined. 
      
      In your example, you did not link to tclstub86, but to the tcl86, which I understood to be the static lib.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  9. Ticket change [f7ea773973] (rid 133659) by anonymous on 2013-09-03 22:07:25:

    1. icomment:
      Just another note: 
      
      I did some more research and checked here: 
      http://tcl.activestate.com/doc/howto/stubs.html
      
      Perhaps a better description of this bug is "Dynamic Linking thru tclStubs requires UNICODE on windows"
      
      With the way tclDecls.h is defined, you cannot use stubs on Windows unless UNICODE is defined.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  10. Ticket change [bbdc4bd7cd] (rid 133669) by anonymous on 2013-09-04 09:56:48:

    1. icomment:
      After compiling the example program given earlier by jan, I see that UNICODE is not the problem.  I apologize.
      
      The problem is compiling against the tclstub lib. I have yet to build an example that complies and not crash.    But that is probably on my end.
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  11. Add attachment "if_tcl.c.diff" [8dbf6cf24a] (rid 133704) by jan.nijtmans on 2013-09-06 22:49:16.

  12. Ticket change [84ebaeac72] (rid 133705) by jan.nijtmans on 2013-09-06 22:53:12:

    1. closedate changed to: "2456542.45361737"
    2. closer changed to: "jan.nijtmans"
    3. icomment:
      I see the problem. Attached to this ticket is a patch for if_tcl.c how this should be solved.
      
      The problem is that Tcl_FindExecutable() should be called BEFORE Tcl_CreateInterp(), which cannot be done through the stub table
      because it is not initialized yet. See the attached patch for
      the proper way how to do this. Tcl_FindExecutable() is in
      the stub table, but that was a design mistake. In Tcl 8.6
      that cannot be done any more, that's on purpose.
      
      I hope this helps you further.
      
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
  13. Ticket change [b5bd32378f] (rid 133706) by jan.nijtmans on 2013-09-06 23:09:59:

    1. closedate changed to: "2456542.46527535"
    2. icomment:
      Reported to the VIM people as well:
      
      [https://code.google.com/p/vim/issues/detail?id=167]
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"