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
lsqlite3.sofor x86, but need arm64. How did you installlsqlite3.so? Is it possible that you installed a Linux tarball?find / -name "lsqlite.so"in a terminal to see if you can locate the library file.