64-bit Win compile of Tcl interface, revisited
(1) By Gerry Snyder (GSnyder) on 2020-09-20 04:00:18 [link] [source]
I have paused trying MSYS2, and am seeing if MSVC might be easier. I have magicsplat Tcl installed in c:/Program Files/Tcl which is the rules.vc default location. The compilation seems fine, but the link step fails. Below is the output from running nmake: sqlite-autoconf-3330000\tea\win> nmake /f makefile.vc Microsoft (R) Program Maintenance Utility Version 14.27.29111.0 Copyright (C) Microsoft Corporation. All rights reserved. =============================================================================== *** Compiler has 'Optimizations' *** Compiler does not have 'Pentium 0x0f fix' *** Linker does not have 'Win98 alignment problem' *** Intermediate directory will be '.\Release_VC13\tclsqlite3_ThreadedDynamic' *** Output directory will be '.\Release_VC13' *** Suffix for binaries will be 't' *** Optional defines are '-DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED' *** Compiler version 13. Target machine is IX86 *** Host architecture is AMD64 *** Compiler options '-W3 -DUNICODE -D_UNICODE -Ot -Oi -fp:strict -Gs -GS -GL -RTC1 -W3' *** Link options '-ltcg' cl -DBUILD_sqlite -DUSE_TCL_STUBS -DPACKAGE_VERSION="\"3.33.0\"" -nologo -c -W3 -D_CRT_SECURE_NO_WARNINGS -YX -Fp.\Release_VC13\tclsqlite3_ThreadedDynamic\ -O2 -Op -Gs -MD -I"C:\Program Files\Tcl\lib\..\include" -I"..\win" -I"..\generic" -I"..\.." -DSQLITE_3_SUFFIX_ONLY=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_OMIT_DEPRECATED=1 -DTCL_CFGVAL_ENCODING=\"cp1252\" -DSTDC_HEADERS -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -DNDEBUG -DTCL_CFG_OPTIMIZED -DBUILD_tclsqlite3 -Fo.\Release_VC13\tclsqlite3_ThreadedDynamic\ -c ..\generic\tclsqlite3.c cl : Command line warning D9002 : ignoring unknown option '-YX' cl : Command line warning D9002 : ignoring unknown option '-Op' tclsqlite3.c link -nologo -machine:IX86 -release -opt:ref -opt:icf,3 -dll -out:.\Release_VC13\tclsqlite3.dll "C:\Program Files\Tcl\lib\..\lib\tclstub86.lib" @C:\Users\mesme\AppData\Local\Temp\nm32A0.tmp Creating library .\Release_VC13\tclsqlite3.lib and object .\Release_VC13\tclsqlite3.exp tclsqlite3.obj : error LNK2019: unresolved external symbol _Tcl_InitStubs referenced in function _Sqlite3_Init tclsqlite3.obj : error LNK2019: unresolved external symbol _tclStubsPtr referenced in function _incrblobClose .\Release_VC13\tclsqlite3.dll : fatal error LNK1120: 2 unresolved externals I have no idea what to do about the missing symbols.
(2) By Andreas Kupries (andreas-kupries) on 2020-09-20 04:34:13 in reply to 1 [link] [source]
Hi Gerry.
The missing symbols look to be something which should be provided by Tcl's stubs library, i.e. libtclstub.a or whatever the equivalent name under Windows(tm).
I suspect that whatever Makefile you use is not supplying this library to the link step, or supplying it incorrectly.
As I am not firm (anymore) with regard building on Windows, I would recommend/propose to ask the question on the tcl-core mailing list, and then feed any corrections you get back to Richard so that he can update the Makefile in question.
IIRC Jan Nijtmans is doing Windows-builds, and listening on Tcl-core. Other names I remember as associated with Tcl on Windows are Harald Oehlmann and Francois Vogel, also on that list.
Hopefully this helps.
(3) By Gerry Snyder (GSnyder) on 2020-09-20 17:41:22 in reply to 2 [source]
Thank you for your response.
apn found what I was doing wrong. I needed to run vcvars64.bat and then do the nmake in the same command window. Without that I was doing a 32-bit compile using a 64-bit Tcl.
I am a happy camper now.
Gerry