On Wed, Jul 22, 2009 at 4:31 PM, "Cédric Floquet (GMail)"<cedric.floq...@gmail.com> wrote: > Hi, > > I'm trying to understand how to build the wx.so lib as a standalone, to > use it with a standard Lua interpreter, but i can't quite grasp what's > needed to succeed. I've been trying for a few hours, to no avail. > > I'm using Ubuntu 9.04 x64, and have all the compilers and libs needed to > compile stuff. Here's what i did: > > 1. I downloaded Lua 5.1 source code, libs and headers (well actually it > comes from Lua Binaries). In case i wouldn't, there's a built in version > with wxLua anyway. It works, and i've successfully build some C modules > against it (luaglut and its examples work perfectly)
The Lua src in wxLua/modules/lua/src is the source from the Lua 5.1.4 tar.gz. > 2. Since i wanted to control the wxWidgets version used, i downloaded > the source (2.8.10), configured and compiled it, without installing it. > It worked, but i must admit i'm not sure about the configure options i > should use that could have a (positive or negative) influence on step This is what I use for wxWidgets, for better or for worse. ../configure \ --prefix=/home/john/wx/wxWidgets/wxWidgets-2.8.10/config_gtk2ud \ --enable-optimise=no \ --enable-debug=yes \ --enable-debug_gdb=yes \ --enable-mem_tracing=no \ --enable-profile=no \ --with-dmalloc=no \ --enable-prologio=no \ --enable-gtk2=yes \ --enable-unicode=yes \ --with-gnomeprint \ --enable-mediactrl=yes \ --with-opengl \ --enable-graphics_ctx \ --with-sdl > 3., i.e. the compilation of wxLua (i'm only interested in wx.so). I've > tried to compile wxWidgets with shared enabled, disabled, and > with/without the monolithic option. I guess what i want is shared, and > monolithic (unlesse there's a way to compile wxWidgets statically, then > create a shared wx.so using it?) This should handle creating the monolithic wx.so module regardless of the other settings, I think. configure --enable-monolithic-luamodule > 3. I downloaded the wxLua source code, configured it so it would find my > "system" Lua (the one i downloaded, not the Ubuntu packaged one). This > works. I also configured it to find the custom compiled wxWidgets > directories. This works too. The part i'm not sure about is the same as > for wxWidgets, i.e. the shared option, the luamodule and > monolithic-luamodule options, etc. The only way i manage to get wx.so > built is by enabling the shared option. That's ok, but when i try to put > the resulting lib/wx.so in my lua bin directory from step 1., then > require "wx", it complains about missing "sub libs" that wx.so depends > upon. I thought that "shared" was to create a wx.so, but that monolithic > would make it independent from anything else. I'll have to look into how "monolithic" we can actually make it. You absolutely have to link to the Lua shared lib, but it might be possible to compile wxWidgets statically to allow the wxLua module to incorporate the wxWidgets libraries. If you compile wxWidgets as a shared lib, then no, it cannot be incorporated into wx.so and will be a dependence. I did find a bug in the configure generated modules/Makefile. Look for these statements and notice that I removed the $(WXLUA_LIBS) from it. The real fix goes into the Bakefiles, but I have to verify that it's Ok to do that for the MSW builds. ../lib/$(DLLPREFIX_MODULE)wx.$(SO_SUFFIX_MODULE): $(MOD_LUAMODULE_MONO_OBJECTS) $(SHARED_LD_MODULE_CXX) $@ $(MOD_LUAMODULE_MONO_OBJECTS) $(LDFLAGS) -L$(top_builddir)/lib -L$(LUA_LIB_DIR) $(LIBS) $(WX_LIBS) #$(WXLUA_LIBS) <-- remove this from the line above > True, when i run ldd on wx.so, the missing libs are mentioned. On the > other hand, a pre-compiled wx.so like the one in Lua All in One shows no > such dependencies, so there must be a way... What libs are missing for you (see below) and I wonder what the All in One folks are doing? > What am i doing (or getting) wrong here ? If you have unresolved lib dependencies, as seen using ldd, you can add search paths like this. $export LD_LIBRARY_PATH=/path/to/the/wxLua/libs Hope this helps, John ------------------------------------------------------------------------------ _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users