Skip to content

sqlite3 1.4.0 does not build on Windows ("missing function dlopen") #259

@stomar

Description

@stomar

gem install fails on Windows with error missing function dlopen.

Steps (in my case on Windows 7 Professional, 64 Bit, Ruby 2.5.1, msys2):

  • install Ruby via rubyinstaller-2.5.1-2-x64
  • ridk install
  • gem update —system (unrelated to the problem, necessary for bundler)
  • gem install sqlite3 -v 1.4.0

After some hours of searching, testing, and frustration I came up with the following workarounds that work for my setting:

Fix 1

bundle install with a Gemfile that includes the following line:

gem "sqlite3", git: "https://github.com/larskanis/sqlite3-ruby", branch: "revert-dl"

This reverts the check for the presence of the dl functions, as proposed in #254.

In my case the install succeeded, and I was able to use sqlite3 for accessing a database. I have no idea whether these functions are needed for some functionality, and whether this might blow up at some point. The mentioned PR states they are not needed.

(This is similar to a fix that can be found in various issues and blog posts, there with branch: "add-gemspec", but with an updated branch based on current master.)

Fix 2a

Manually install the missing dl functions before trying to install the gem, via

$ ridk exec pacman -S mingw-w64-x86_64-dlfcn

As suggested in #250.

Fix 2b

bundle install with a Gemfile that includes the following line:

gem "sqlite3", git: "https://github.com/stomar/sqlite3-ruby", branch: "add-dlfcn"

This is similar to fix 2a, but instead of the manual install adds dlfcn as a dependency to the slite3 gemspec, see #260.

Conclusion

Please consider to either

Note that there already have been two issues opened for this problem (#250, #248), but they have been closed (prematurely IMO) by the authors after they had been provided with a workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions