Lua lib that works on the Mac

Mac OSX specific forum
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Lua lib that works on the Mac

Post by DoubleDutch »

Does anyone have a link to a Mac Lua 5.1.4 or 5.1.5 lib that works with PureBasic (32-bit) and this include file:

http://www.purebasic.fr/english/viewtop ... 6&start=30
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Lua lib that works on the Mac

Post by wilbert »

I never used Lua but are the pre built binaries not working ?
http://luabinaries.sourceforge.net/download.html
Windows (x64)
Raspberry Pi OS (Arm64)
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Lua lib that works on the Mac

Post by DoubleDutch »

No, they fail at the link stage with then being x86-x64 and the code being i386 (or the other way around) apparently - even though its the same thing.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Lua lib that works on the Mac

Post by wilbert »

I'm sorry I don't have an answer for your problem in that case but is there any reason for using the 32 bit version of PureBasic on OSX ?

OSX isn't Windows. Since OSX 10.7 there is no 32 bit version of the OS anymore.
The oldest OSX version PureBasic currently supports (10.6) did come in both a 32 and 64 bit version but even the 32 bit version is capable of running 64 bit applications.
The only Intel Macs which aren't capable of running 64 bit software are some of the models released in 2006 that had a 32 bit CPU.
You can of course still run (and develop) 32 bit software but new OS features are often only available in 64 bit mode and if you want to submit an application to the Mac App Store, you must provide 64 bit support.
Besides Apple itself also other large companies dropped 32 bit OSX support. Adobe for example with Photoshop CS6 (Released May 2012) which is 64 bit only.
Windows (x64)
Raspberry Pi OS (Arm64)
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: Lua lib that works on the Mac

Post by jack »

it looks to me that LuaBinaries only provides 64-bit libs for os x, don't know if the lib would build without problems, am too busy at the moment to try.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Lua lib that works on the Mac

Post by DoubleDutch »

@Wilbert My app needs to run on Macs from Snow Leopard to now, including both 32 and 64 bit versions of the OS - as 32 bit programs work on both then that seems to be the best choice.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: Lua lib that works on the Mac

Post by jack »

hello DoubleDutch
from the lua website
curl -R -O http://www.lua.org/ftp/lua-5.1.5.tar.gz
tar zxf lua-5.1.5.tar.gz
cd lua-5.1.5
make macosx
but before you issue the command make macosx change the makefile that's in lua-5.1.5/src/
change CFLAGS= -O2 -Wall $(MYCFLAGS) to CFLAGS= -m32 -O2 -Wall $(MYCFLAGS)
then do make macosx
the library will be built to 32-bit but you will receive errors at the end of compile due to makefile trying to build a 64-bit test program using a 32-bit lib
I think you can ignore the errors
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Lua lib that works on the Mac

Post by wilbert »

DoubleDutch wrote:@Wilbert My app needs to run on Macs from Snow Leopard to now, including both 32 and 64 bit versions of the OS - as 32 bit programs work on both then that seems to be the best choice.
Snow Leopard 32 bit can also run 64 bit applications if the CPU supports 64 bit.
Only if you really need it to run on all Intel Macs ever produced, you need a 32 bit version.

The pre-build files do include a 32 bit Lua (5.1.4) version build for OSX 10.5 Leopard.
https://sourceforge.net/projects/luabin ... z/download
Maybe that one will work.
Windows (x64)
Raspberry Pi OS (Arm64)
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: Lua lib that works on the Mac

Post by jack »

@DoubleDutch
I successfully run the your test program using the lib built as described above, only had to modify the pbi file with the correct lib name
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Lua lib that works on the Mac

Post by DoubleDutch »

Thanks, that worked. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply