Require .so - Wrong Architecture

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
10Print
Prole
Posts: 3
Joined: Tue Dec 08, 2009 11:20 am
Location: Halifax
Contact:

Require .so - Wrong Architecture

Post by 10Print »

I'm having issues loading external libraries into Love.
For example, I have lrandom compiled to "/usr/local/lib/lua/5.1/random.so".
In plain old lua require("random") works fine, but when I try and do the same thing in Love, I get this error:

Code: Select all

function love.load()
    require("random")
end

Code: Select all

error loading module 'random' from file '/usr/local/lib/lua/5.1/random.so': 
dlopen(/usr/local/lib/lua/5.1/random.so, 2): no suitable image found. 
Did find: /usr/local/lib/lua/5.1/random.so: mach-o, but wrong architecture
Thoughts? (This happens with both Love 5 and 6... I'm on OS X 10.6.2 and have Lua 5.1.4 installed.)
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

Re: Require .so - Wrong Architecture

Post by bmelts »

The problem is exactly what OS X reported to you: lrandom is the wrong architecture. LÖVE is a 32-bit app on Mac OS X, and it can't load a library that's been compiled in 64-bit mode, as lrandom almost certainly was if you compiled it on Snow Leopard.

In the absence of a 64-bit love.app (I'd have to redo most of the frameworks to make that possible, since I don't think any of them have 64-bit architectures included - this is a future project), you'll need to recompile lrandom in 32-bit mode for it to be usable.

Also keep in mind that external libraries are not usable from within the .love file at this point, due to limitations with PhysFS. So if you wanted to distribute a LÖVE game that used lrandom, you'd need to make sure your users have it installed prior to running your game.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 7 guests