SQLite Forum

64-bit Win compile of Tcl interface
Login

64-bit Win compile of Tcl interface

(1) By Gerry Snyder (GSnyder) on 2020-09-14 22:29:00 [source]

For years I have done 32-bit compilations of the Tcl interface using MSYS/MinGW, with ./configure and make.

I want to the the same but 64-bit. There is MinGW-w64, but I have not been able to figure out to use it. It does not come with MSYS. I copied the msys folder from the 32-bit MinGW, and ran a compile from there. It seemed to run, but a 64-bit tclkit did not like the dll file. The error message suggested a possible 32/64-bit mismatch.

Dependency Walker shows the top level as KERNEL32.DLL

Any suggestions for how to fix this, or a better way to go?

(2) By Keith Medcalf (kmedcalf) on 2020-09-14 22:59:19 in reply to 1 [link] [source]

Why not see if MSys2 meets your needs?

(3.2) By Gerry Snyder (GSnyder) on 2020-09-15 04:25:49 edited from 3.1 in reply to 2 [link] [source]

Thank you for the pointer. I was not aware of MSys2.

I have made some progress, but still not there. Installed MSys2, and added packages for make and gcc.

In a MINGW64 window ./configure runs, and mingw32-make gets started, but terminates with:

./../sqlite3.c:43082:22: warning: ‘sqlite3Win32Wait’ defined but not used [-Wunused-function] 43082 | SQLITE_PRIVATE DWORD sqlite3Win32Wait(HANDLE hObject){ | ^~~~~~~~~~~~~~~~

rm -f libsqlite3.33.0 o libsqlite3.33.0 tclsqlite3.o -lpthread -Wl,-ltclstub8.6 process_begin: CreateProcess(NULL, o libsqlite3.33.0 tclsqlite3.o -lpthread -Wl,-ltclstub8.6, ...) failed. make (e=2): The system cannot find the file specified. mingw32-make: [Makefile:263: libsqlite3.33.0] Error 2 (ignored) : libsqlite3.33.0

and does not create the dll file.

I will have to compare the outputs from the 32-bit and 64-bit versions of the make command and try to see what went wrong.

So thank you for getting me going with MSys2.

Gerry

(4) By Gerry Snyder (GSnyder) on 2020-09-15 20:13:15 in reply to 3.2 [link] [source]

Still don't have a working dll, but making progress.

The problem I ran into yesterday was caused by an error in the Makefile created by ./configure -- it set SHLIB_LD to "" (blank).

I edited the Makefile line to

SHLIB_LD = ${CC} -shared

which is what the 32-bit Makefile has, and running make completed and created libsqlite3.33.0

It won't load, and has the error message "this library or a dependent library could not be found in library path." I am pretty sure the pkgIndex is what it should be.

I don't know what I can do about this other than see if any compile options were incorrect, but I may try to figure what went wrong with the configure script.

(5) By Keith Medcalf (kmedcalf) on 2020-09-15 20:50:39 in reply to 4 [link] [source]

I presume that this is supposed to be a Windows PE file (DLL or EXEcutable). You can use the depends utility for Windows to take a peek at the references that the module is trying to load. There will be a shitload of "API interfaces" that cannot be found that you can ignore such as anything that starts with "API-" or "EXT-" plus several other obviously Microsoft named "magic" (the files do actually exist it is just that depends does not know how to find them)

You can find depends here (self-contained executable file):
https://www.dependencywalker.com/

See also another version that requires a "poo load of dependencies that are included" but can work from the command line:
https://github.com/lucasg/Dependencies

Both of them install in the "old fashioned manner" as in unzip and put in the path, none of this "run a silly installer that fills the computer with malicious crappola" that is so common in these days of Eternal September.