2

I'm attempting to build and fix UCL RAT for running on windows compiled with VS 2010. I've compiled TCL 8.5.12 successfully under Visual studio 2010 and the main RAT executable.

RAT uses TCL to drive it's user interface.

The problem arose when I started to modify RAT to embed the TCL code normally stored as a string into a zip file instead using zvfs. The intention is to eventually embed the zip at the end of the executable to minimise disk usage and the number of distribution files.

So I downloaded some code for zvfs from the TOBE project to see if I could use it to make the process quicker (specifically the zvfs.c file that is basically the zvfs extension to tcl)

This required Zlib in order to run which built and integrated fine.

But the problem is the zvfs code doesn't link properly with TCL. It passes compilation but has the following errors upon linking:

2>zvfs.obj : error LNK2019: unresolved external symbol _TclOpenFileChannelInsertProc referenced in function _Zvfs_Init
2>zvfs.obj : error LNK2019: unresolved external symbol _TclStatInsertProc referenced in function _Zvfs_Init
2>zvfs.obj : error LNK2019: unresolved external symbol _TclAccessInsertProc referenced in function _Zvfs_Init

not being as experienced with c/c++ and the linker as I could be this has become somewhat of a road block in fixing RAT for more modern versions of windows.

The version of RAT is the latest from the UCL subversion server, Zlib is at version 1.2.7 if this has any impact.

Cheers

1 Answers1

1

Those particular functions are obsolete, but still supported in the correct build up to Tcl 8.5 (including 8.5.12). You need to use a compile where you define the preprocessor symbol USE_OBSOLETE_FS_HOOKS (to be anything) during a clean build of the Tcl library. Alas, this means you need to edit the build instructions away from the default, and that's where I can't help as I use a totally different build chain (on a different platform) from you.

Also, when linking you need to link against the Tcl library itself and not its stub library.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
  • Note that the code _will not work at all_ from Tcl 8.6 onwards, as those obsolete functions have been removed. TOBE will need to be updated to use the VFS API that replaced those hooks. – Donal Fellows Nov 27 '12 at 08:59
  • Thanks that did solve my linking issue, although in the long run it will be better to modify the zvfs code to match the new tcl hooks. I still haven't managed to get RAT working but it's not the fault of the zvfs code, I suspect the tcl scripts themselves need updating. – user1855149 Nov 28 '12 at 01:00
  • You might be better off rolling back to 8.4 for RAT if it is that sensitive to versions; that's still a supported Tcl version. – Donal Fellows Nov 28 '12 at 08:53