Hi Russ,
> dynamic libraries not enabled; check your Lua installation
You need to have `LUA_USE_DLOPEN` defined (it's `LUA_DL_DLL` on
Windows); using LUA_USE_LINUX should enable that as well.
Ah, ha! CMake newb mistake:
OPTION ( LUA_USE_POSIX "Use POSIX functionality." ON )
is not the same as
ADD_DEFINITIONS (-DLUA_USE_POSIX)
The first one is a CMake variable, the second is a C define. Oops.
Russ
Paul.
On Tue, Jan 26, 2021 at 3:44 PM Russell Haley <russ.haley@gmail.com> wrote:
>
> Hi,
>
> I have a small C/Lua/IUP project that was working on Windows. I am trying to port it over to Linux. I have managed most aspects of the cross-migration but my application is still failing with the following error:
>
> Couldn't load file: error loading module 'iuplua' from file 'iup-toolkit/libiuplua.so':
> dynamic libraries not enabled; check your Lua installation
>
> I have definitely built a shared object for Lua: liblua54.so. I "sprinkled" liblua54.so around very liberally in every directory that I thought it might be needed, but that has no effect.
>
> If I run the Lua executable created with that shared object it also gives me the error:
>
> starfish@linux-dev-2:~/starfishIUPGui/cmake-build-debug$ ls
> CMakeCache.txt CMakeFiles cmake_install.cmake iup-toolkit lfs-1.8.0 lfs.so liblfs.so liblua54.so lua lua-5.4 Makefile MyCProject.cbp share starfishIUPGui starfishIUPGui.cbp
> starfish@linux-dev-2:~/starfishIUPGui/cmake-build-debug$ ./lua
> Lua 5.4.0 Copyright (C) 1994-2020 Lua.org, PUC-Rio
> > require 'lfs'
> error loading module 'lfs' from file './lfs.so':
> dynamic libraries not enabled; check your Lua installation
> stack traceback:
> [C]: in ?
> [C]: in function 'require'
> stdin:1: in main chunk
> [C]: in ?
> >
>
> Have I missed a define or something? Any hit would be very helpful?
>
> Thanks,
> Russ