1

Important edit: it think that the issue might come from the fact that I'm using a Mac that uses an Arm64 processor. However, I'm not entirely sure since I don't know what that means.

I'm trying to use lua sqlite within love2D. I'm not sure how exactly to phrase this, but I should clarify that I'm trying to make it work specifically with love2d so that I can distribute it without anyone needing to install everything on their end. But i was led to this file by the official website. I followed the instructions and copied it into my project folder, required it with local sqlite3 = require("sqlite3") (this is the main.lua:3 referenced in the error message) only for it to give this error message when attempting to load love:

Error

error loading module 'lsqlite3' from file 'Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so':
dlopen(Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so, 0x0006): tried: 'Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OSUsers/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (no such file), '/Applications/love.app/Contents/MacOS/../Frameworks/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (no such file), '/Applications/love.app/Contents/Frameworks/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (no such file), '/usr/lib/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (no such file, not in dyld cache), 'Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/Users/(name)/Documents/code/luasqlite test/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/(name)/Documents/code/luasqlite test/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (no such file), '/Users/(name)/Documents/code/luasqlite test/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3/lsqlite3.so' (fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64'))


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: at 0x01051ef318
[C]: in function 'require'
sqlite3.lua:279: in function 'init'
sqlite3.lua:1032: in main chunk
[C]: in function 'require'
main.lua:3: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'

At this point, all that I have in my main.lua file is

local love = require "love"

local sqlite3 = require("sqlite3")

local db = sqlite3.open("Normal_Translations.db")

so I have to assume it's an issue with requiring sqlite3

This is my first time trying to do something like this, so I'm unsure what it means or how I can fix it. What can I do to prevent this issue from happening?

looking at the error message leads me to these lines from the lsqlite3.lua file:

--require the dll/so
sqlite3 = require("lsqlite3");

and

init();

which just seems to call the function the first line was within

12
  • It looks like you might have an older version of Love2D installed. Support for arm64 was added in Love2D v11.4; the most recent version is v11.5. What version are you using? If you just recently installed Love2D, maybe you grabbed the wrong tarball. Commented Oct 1 at 2:38
  • according to love.getVersion I have v11.5.0. Love also runs fine normally, so I believe it the issue is something related to the sqlite thing (since it fails once I add that in) I just don't know what it is. Commented Oct 1 at 2:54
  • The error message says that you have lsqlite3.so for x86, but need arm64. How did you install lsqlite3.so? Is it possible that you installed a Linux tarball? Commented Oct 1 at 2:59
  • Looking through, I actually didn't install lsqlite3.so myself. I only downloaded the original sqlite3.lua from the github page (and added it to my project folder). However, when I try to run the code in love2d, it actually created a new folder in my project folder named "users" which eventually leads to the lsqlite3.so file. the actual path is /Users/(name)/Documents/code/luasqlite test/Users/(name)/Library/Application Support/LOVE/luasqlite test/plugins/sqlite3, and there's nothing else in the folder. Commented Oct 1 at 3:06
  • Maybe try find / -name "lsqlite.so" in a terminal to see if you can locate the library file. Commented Oct 1 at 3:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.