Arnold Cross
Arnold Cross

Reputation: 329

Perl DBD::SQLite installation fail on win7

I never installed DBI or DBI::SQLite, because they seem to be built into my Perl v5.32 installation. They have been working fine in a script I'm developing, which is now about 300 lines, but I recently ran into an encoding issue. I found the following example lines at https://metacpan.org/pod/DBD::SQLite,

use DBI qw(:sql_types);
use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
$dbh->{sqlite_string_mode} = DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK;

, and it looks like the following variation should solve my problem. (Identical, except that I replace FALLBACK with BYTES.)

use DBI qw(:sql_types);
use DBD::SQLite::Constants ':dbd_sqlite_string_mode';      # line 16
$dbh->{sqlite_string_mode} = DBD_SQLITE_STRING_MODE_UNICODE_BYTES;

However, I get the following error when I run that. (drive backup,.compl is the name of my script file.)

"dbd_sqlite_string_mode" is not defined in %DBD::SQLite::Constants::EXPORT_TAGS at drive backup,.compl line 16.

If I run this from the command line,

cpanm DBD::SQLite::Constants

, it gives me this:

DBD::SQLite::Constants is up to date. (undef)

But, if I run this,

cpanm DBD::SQLite

, it gives me this:

--> Working on DBD::SQLite Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/DBD-SQLite-1.70.tar.gz ... OK Configuring DBD-SQLite-1.70 ... OK Building and testing DBD-SQLite-1.70 ... FAIL ! Installing DBD::SQLite failed. See C:\Users\arnold.cpanm\work\1637612566.1020 0\build.log for details. Retry with --force to force install it.

See below for images of the build log. The first indication of a problem seems to be a warning about "cast from pointer to integer of different size". After that, a lot of things seem to be going wrong. I don't want to force the install.

My OS is Windows 7 x64 Pro. If DBD::SQLite has moved beyond win7, then I can probably work around my encoding issue with Encode, but that approach is more tedious. I would much rather get the DBD::SQLite update to complete successfully, so I can (hopefully) use the handle attribute.

I couldn't figure out how to attach the build log, but here are some images of it. The first one is the beginning. The first indication of a problem is at the very bottom of that image. The second image is contiguous with the first one in the log, and it shows repeating problems. The third image is the end of the log. There are over a thousand of those undefined reference lines before the log comes to an end. Start of the build log Indications of problems End of build log

Upvotes: 1

Views: 222

Answers (1)

Arnold Cross
Arnold Cross

Reputation: 329

I solved my encoding issue using Encode. That solution wasn't as tedious as I expected. DBD::SQLite v1.70 appears to offer much enhanced encoding capabilities over v1.66, but I couldn't get it to install on Perl v5.32.1.1. I don't know if it's supposed to be compatible, but at this point, it doesn't matter to me. v1.66, which comes with Perl v5.32, is working as advertised, and Encode provides the methods that I need for managing my string data.

Upvotes: 1

Related Questions