Mac - Dynamic libraries not enabled: check your lua installation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Mac - Dynamic libraries not enabled: check your lua installation

aryajur
Hello,
       I have made a C module for Lua 5.2.3. I am using Code::Blocks as my IDE to do all compilation. Here are the steps I follow:

1. I build Lua 5.2.3 as a dynamic library with an import library. 
2. I use the import library to build the Lua interpreter. 
3. I use the import library to build my C module. 
4. I launch the interpreter with the lua dynamic library and my c module in the current directory. 

This whole process works well in windows and linux(ubuntu) but when I run the same process on a Mac I get this error as soon as I require my C module:

Dynamic libraries not enabled: check your lua installation

How can I fix this? Any help would be really appreciated.

Thanks,
Milind


Reply | Threaded
Open this post in threaded view
|

Re: Mac - Dynamic libraries not enabled: check your lua installation

Paul K
Hi Milind,

> Dynamic libraries not enabled: check your lua installation

>From [1]: the message "dynamic libraries not enabled" comes from the
fallback code in loadlib.c and this code should not be reached if
LUA_USE_DLOPEN is defined.

I use LUA_USE_LINUX on OSX, but using LUA_USE_DLOPEN should be sufficient [2].

Paul.

[1] http://lua-users.org/lists/lua-l/2011-01/msg01185.html
[2] http://lua-users.org/lists/lua-l/2007-04/msg00068.html

On Wed, May 7, 2014 at 10:49 AM, Milind Gupta <[hidden email]> wrote:

> Hello,
>        I have made a C module for Lua 5.2.3. I am using Code::Blocks as my
> IDE to do all compilation. Here are the steps I follow:
>
> 1. I build Lua 5.2.3 as a dynamic library with an import library.
> 2. I use the import library to build the Lua interpreter.
> 3. I use the import library to build my C module.
> 4. I launch the interpreter with the lua dynamic library and my c module in
> the current directory.
>
> This whole process works well in windows and linux(ubuntu) but when I run
> the same process on a Mac I get this error as soon as I require my C module:
>
> Dynamic libraries not enabled: check your lua installation
>
> How can I fix this? Any help would be really appreciated.
>
> Thanks,
> Milind
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Mac - Dynamic libraries not enabled: check your lua installation

Doug Currie
In reply to this post by aryajur
This whole process works well in windows and linux(ubuntu) but when I run the same process on a Mac I get this error as soon as I require my C module:
Dynamic libraries not enabled: check your lua installation

In the Lua 5.2.3 Makefile:

macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc

and in  src/luaconf.h:

#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
#endif

So, define LUA_USE_MACOSX in your build.

e

Reply | Threaded
Open this post in threaded view
|

Re: Mac - Dynamic libraries not enabled: check your lua installation

aryajur
Thank you very much for the reply. I will try it out.

Thanks,
Milind



On Thu, May 8, 2014 at 12:28 PM, Doug Currie <[hidden email]> wrote:
This whole process works well in windows and linux(ubuntu) but when I run the same process on a Mac I get this error as soon as I require my C module:
Dynamic libraries not enabled: check your lua installation

In the Lua 5.2.3 Makefile:

macosx:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" CC=cc

and in  src/luaconf.h:

#if defined(LUA_USE_MACOSX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* does not need -ldl */
#define LUA_USE_READLINE /* needs an extra library: -lreadline */
#define LUA_USE_STRTODHEX /* assume 'strtod' handles hex formats */
#define LUA_USE_AFORMAT /* assume 'printf' handles 'aA' specifiers */
#define LUA_USE_LONGLONG /* assume support for long long */
#endif

So, define LUA_USE_MACOSX in your build.

e