• building a simple extension on windows

    From alan folsom@21:1/5 to All on Tue Nov 16 11:08:26 2021
    Many years ago with TCL 8.5 I wrote a very simple extension on windows.

    I could build it with this command line:
    gcc -m32 -shared -o GetCRC.dll getcrc.c -DUSE_TCL_STUBS -IC:\tcl85\include -l tclstub85

    but now trying to generate it again (using TCL 8.6 and the correct library designations) I get error messages that it can't find the stub pointers, or of if I try to build it without stubs it can't find the functions. I'm a month from retirement, and my
    replacement wants to try it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Tue Nov 16 21:59:33 2021
    Am 16.11.21 um 20:08 schrieb alan folsom:
    Many years ago with TCL 8.5 I wrote a very simple extension on windows.

    I could build it with this command line:
    gcc -m32 -shared -o GetCRC.dll getcrc.c -DUSE_TCL_STUBS -IC:\tcl85\include -l tclstub85

    In general, that should be it.
    but now trying to generate it again (using TCL 8.6 and the correct library designations) I get error messages that it can't find the stub pointers, or of if I try to build it without stubs it can't find the functions. I'm a month from retirement, and
    my replacement wants to try it.

    Your line includes "-m32" which builds for 32 bit - is this intended? If
    so, did you make sure that indeed the libraries are 32bit libraries? I'm
    asking because today it is very unlikely that you have a Tcl compiled in
    32 bit.

    The other thing, there is no linker path in your line. Where does it
    pick up tclsub85? Maybe you should give it -LC:\.... before the
    -ltclstub85 in order to be sure that t uses the right library.

    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From alan folsom@21:1/5 to Christian Gollwitzer on Wed Nov 17 11:11:20 2021
    On Tuesday, November 16, 2021 at 3:59:38 PM UTC-5, Christian Gollwitzer wrote:
    Am 16.11.21 um 20:08 schrieb alan folsom:
    Many years ago with TCL 8.5 I wrote a very simple extension on windows.

    I could build it with this command line:
    gcc -m32 -shared -o GetCRC.dll getcrc.c -DUSE_TCL_STUBS -IC:\tcl85\include -l tclstub85
    In general, that should be it.
    but now trying to generate it again (using TCL 8.6 and the correct library designations) I get error messages that it can't find the stub pointers, or of if I try to build it without stubs it can't find the functions. I'm a month from retirement, and
    my replacement wants to try it.
    Your line includes "-m32" which builds for 32 bit - is this intended? If
    so, did you make sure that indeed the libraries are 32bit libraries? I'm asking because today it is very unlikely that you have a Tcl compiled in
    32 bit.

    The other thing, there is no linker path in your line. Where does it
    pick up tclsub85? Maybe you should give it -LC:\.... before the
    -ltclstub85 in order to be sure that t uses the right library.

    Christian
    Thanks, I missed that "-m32". Unfortunately, I'm still having errors. My build line looks like:
    gcc -shared -o GetCRC.dll getcrc.c -DUSE_TCL_STUBS -IC:\ActiveTCL\include -LC:\ActiveTCL\lib -l tclstub86
    I get a number of errors saying it can't find the stubs ptr: C:\Users\alanf\AppData\Local\Temp\ccwaPt79.o:getcrc.c:(.text+0x86): undefined reference to `tclStubsPtr'
    and also to Tcl_InitStubs. This is pretty basic stuff I did a lot years ago, I'm confused.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)