🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

problems embedding lua

Started by
40 comments, last by nekoflux 20 years, 5 months ago
hey guy:

plz read the above posts, I have tried various permutations of the commands for both lua 4.0.2 and lua 5.0.2. Its not a question of the parameter functions being screwed up. It can''t find the function definition at all.
nekoflux
Advertisement
hmmm t''is very odd, i never had half of these problems, i just grabbed a copy of Lua-build for 5.0, built the libs indepedantly, set the include dir to my lua-builds include dir, same with the libs and away i went.

Might I surgest scubbing your current setup (delete the folders for Lua, remove any paths set etc), download a copy of Lua-build, build that (it comes with a VC6 project iirc), setting all the paths (lib and inc) in VS and trying a simple example again.

Should be a link to Lua-build on the Lua website.
Sorry, but... I''m sure there''s something wrong with your binaries. In the Lua florder, there is a file called INSTALL. In the file, there is a title "Installation on Windows and other systems". And below this title, there are instructions how to compile the distribution. First, compile the core library, using all the files listed. I created a separate project called "lua" and got lua.lib library. Then, I created a project "lualib" and got lualib.lib library, adding the files listed. Here, you must not forget the lauxlib.c file! Building another two projects - executables - is optional and I did not do it since I didn''t want neither the compiler nor the stand-alone interpreter.
Then, I linked lua.lib and lualib.lib to my application and all worked well.

The function is defined in lua/src/lib/lauxlib.c in my distribution.

If you want, I can email you the files I created, but because I work with MS Visual Studio .NET, I''m not sure if they will be compatible.
Society's never gonna make any progress until we all learn to pretend to like each other.
Yeah, I''d have to agree, it sounds as if something is broken with your build. Delete your Lua folder, wipe it out and start from scratch, maybe with the current pre-compiled Windows binaries. It''s really a very simple library, and there shouldn''t be _this_ much trouble with getting it to link.

Golem

Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller
Ok, I''m sure you guys are prob right on the lua library being screwed up..

where are you guys seeing these windows related iles? I went to luas sourceforge site, where everyone says they are located. The onlyfile listed for lua 5.0 is luabuild-5.0.tgz which does not contain any windows specific project files from what I''m seeing.. heres the url to the site i am referring to

http://sourceforge.net/project/showfiles.php?group_id=38461

maybe someone could just send me a copy of the static lib they are using? this library compilation stuff is driving me nuts, and I really dont ever foresee needing to rebuild the library from source (I just need a functional scripting system and don''t plan to modify lua''s internals in any way shape or form)

If you guys cant oblige with providing compiled libs directly, can you point me to a place that does have them? Ive been all over the lua site in search of these files but I dont see them anywhere.

Sorry I know this is getting annoying, I just can''t figure out why this has to be so difficult. I was able to compile fmod, ode, and tinyxml without any problems, but lua is giving me major headaches to build and integrate

I appreciate all your help!!!
nekoflux
d''oh! I''m eating my words, I just found the windows libraries..I''ll try it when I get home

thx
nekoflux
Wait until you start trying to use Lua, you''ll realise all this was in vein. I hated it, but that''s just me.
quote: Original post by downgraded
Wait until you start trying to use Lua, you''ll realise all this was in vein. I hated it, but that''s just me.


Statements like this don''t really help me. To say that you disliked something and then not provide any real feed back as to why i might not or what caused you to dislike it is utterly pointless, not to mention off topic

Lua integration won''t be in vein. The engine team consists of only 2 hardcore programmers but we have 4 guys that are good with level design and artworkl; most of them already know a few interpreter based scripting systems. This will allow us to use the full talents of the team to their maximum potential, and will establish a framework for a scalable modification system that people extending the engine can use. I''m familiar with the arguments for and against scripting, and I''m comfortable with the limitations.

I would also like to point out that I have read many, many, many articles posted in these forums and have noticed some patterns of condescension in reply posts. I came here to solve a technical problem and converse with knowledgable peers; quite frankly I dont have the time or energy to engage in a philosophical debate. Xerxes, Odin and several others have been extremely helpful in helping me diagnose my problems, to them I say thank you. To everyone else who wants to argue simply for the sake of arguing I bid you good day
nekoflux
quote: Original post by nekoflux

Statements like this don''t really help me. To say that you disliked something and then not provide any real feed back as to why i might not or what caused you to dislike it is utterly pointless, not to mention off topic



Whoah, calm down. I was merely saying that I wrangled with LUA for several weeks, expecting it to be clean-sailing. If you like dealing with stack offsets and the like, not to mention not-so-good integration with C++ and classes, then go ahead. I suggest that you look into some helper wrappers to make this sort of integration seamless.

I found that accessing LUA and trying to integrate it into my game was going to be a lot of hard work; LUA used to bomb out - killing not just the VM but my app too.

Most of the documentation I found was too simplistic, all covering the same ground and not adding much. Some sites did seem useful, but by then I''d given up on the language. It didn''t seem to ''embed'' as you would - more like require the development of expensive and copmplicated wrappers to serve my needs.

Not saying that it''s bad or anything, just that it didn''t seem that accessible nor suited to integration with my application. I wish you the best of luck with it.
thanks for clarification...A lot of people just post their thoughts without any clarification and it ends up become a rant. yeah, I see what you mean by difficulty in integrating. These lib issues are annoying. I''ve had a much easier tie integrating other libraries.

I like the way lua is defined though...If I could just get the darn thing to work in my codebase I think it will be a very powerful interface.

I grabbed the libs from the win32 archive that came with the lua5 download, and put them into my test application.
whats strange is, lua_dostring(...) works now, but these 2 commands still generate an error from the compiler complaing the functions can''t be found:
loadstring(luaVM, strLuaInput);
loadfile("a = 1 + 1;\n");

are the static windows libs packaged with lua 5.0''s src possibly for 4.0.2?
nekoflux

This topic is closed to new replies.

Advertisement