OK now I got it working with ugly hack :-)
I undo all changes in loadlib.c and luaconf.h to its original. AND I manually edit the $WXLUAROOTDIR/modules/Makefile and add
-DLUA_USE_LINUX to CFLAGS
and
-Wl,-E -ldl -lreadline -lhistory -lncurses to LDFLAGS
(Just copy from the lua Makefile distribution the linux section)
and everything works as expected :-)
I hope you guys find where it is wrong in the build system and fix it 'officially', I am sorry I do not know enough about it to help.
Cheers,
Steve Kieu <[EMAIL PROTECTED]> wrote:
Ok now things even go more strange :-)
I will describe it so you guys may have clue to really fic the build problem as I do not know much about the bake file system etc...;
- For some reason the LUA_DL_DLOPEN never been defined in loadlib.c Maybe it is the include problem? (I hit it once before though). In loadlib.c it has #include "lua.h" and in lua.h it has included luaconf.h and it should define that LUA_DL_DLOPEN because I explicitly define it in luaconf.h. But it is not. The include round problem somewhere..
So I once again explicitly define LUA_DL_DLOPEN in the file loadlib.c and when compile it spits out unresolve symbol dlopen and dlsym so I have to manually edit the Make add the LDFLAG -ldl so it compiles fine.
Now run wxlua-lua and type require'luasqlmysql' it no longer complain about dynamica lib not enabled ; but it give another error:
undefined symbol: lua_pushvalue
and still no readline support. Of course the lua binary has it all.
To recap here is what I did to 'ugly fix' to enable dynamic lib loading:
* Expilitly define LUA_DL_DLOPEN in loadlib.c
* Explicitly define LUA_USE_LINUX in luaconf.h
* Explicitly define LDFLAG=-ldl in $WXLUAROOTDIR/modules/Makefile
The result is: dyanamic lib loading ok but unresolve symbol lua_pushvalue
I will look into it furthur.......
cheers
John Labenski <[EMAIL PROTECTED]> wrote:On 5/8/06, Steve Kieu <[EMAIL PROTECTED]> wrote:
> I would like to use luasql with wxlua and failled. Do googling and saw some
> old thread about it but not sure how to resolve.
>
> If I do a cd to the lua dir inside wxLua distribution and make; a binary
> lua will be created in bin of wxLua. Using that binary ;
> require'luasqlmysql' is fine.
>
> However if I use the binary wxlua and type require'luasqlmysl' in the
> editor window and run, the console prints the error:
>
> error loading module 'luasqlmysql' from file './luasqlmysql.so':
> dynamic libraries not enabled; check your Lua installation
>
> how can I enable it in wxlua? which is a bit strange as the lua core built
> exactly the same produce lua baniry and works,
It is strange indeed, what platform are you using? I'm guessing Linux?
I just looked at the Makefiles in modules/lua and it looks like the
exact same object files are used for the lualib and the lua executable
so the code in loadlib.c should compile this #ifdefed code for both.
#if defined(LUA_DL_DLOPEN)
...
In the Makefile in apps/wxlua/src it uses this to compile lua, is this
what you did when you compile lua yourself?
lua:
@(cd $(WXLUA_DIR)/modules/lua && make linux)
Regards,
John Labenski
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wxlua-users mailing list
Wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users
[EMAIL PROTECTED]>
S.KIEU
On Yahoo!7
Answers: Real people ask and answer questions on any topic.
S.KIEU
Do you Yahoo!?
Yahoo! Personals: It's free to check out our great singles!