Lua static-linked woes

Started by
4 comments, last by FocusedWolf 18 years ago
OK i'm building it in vs.net 05. I've gotten it to work when i dumped all the files into one project, which is sorta expected. However when i put all the lua code into a static linked project, and add reference to it in the main project... it compiles! Problem is lua gives a weird error when i call luaL_openlibs: "PANIC: unprotected error in call to Lua API (unable to get ModuleFileName) Press any key to continue . . ." If i try to load libraries this way: luaopen_base(L); /* opens the basic library */ luaopen_table(L); /* opens the table library */ luaopen_io(L); /* opens the I/O library */ luaopen_string(L); /* opens the string lib. */ luaopen_math(L); /* opens the math lib. */ then i get an unhandled exception when it gets to luaopen_io. Here's my project (replace "#.com" with "googlepages.com": http://focusedwolf.#.com/LuaIntegration.rar
Advertisement
I had (have) the same problem, here my thread: ((nobody could help...)
http://www.gamedev.net/community/forums/topic.asp?topic_id=378291
But I had the problem only in debug mode. In release mode everything worked fine maybe that will help you.
Any particular reason you don't want to dynamically link? I do this and it works fine...
Wow thx for help... release mode does fix problem. I'll be going to dll now since still need debug mode :P
Wow i thought release mode worked, but i was trying it out in the solution i had with all the code in one project, and not the one with the static linked thing :P ...yea release doesn't work... will try dll.
Hmmm this is weird as can be :P

I decided to setup a project in vs.net 2003... and both static-lib and dll worked.

I imported the project to vs 2005 and both static-lib and dll worked.

by worked i mean i was able to compile...start lua...bind a test function to lua and execute a script calling it... i.e. full on with no errors.

If i repeat those same steps purely with vs 2005, static linked compiled but i get that error i previoussly mentioned. If i try with dll i get this build error:
Error 42 fatal error LNK1104: cannot open file '..\debug\lua.lib'

So obvioussly the problem lies in the property pages, or hidden imported properties somewhere,... so what switches do i have to turn on? I tried simply matching the imported projects's settings with my "pure" vs 05 settings but lua didn't like that... generating that error..
"PANIC: unprotected error in call to Lua API (unable to get ModuleFileName)
Press any key to continue . . .""

I don't want to use the working, but imported vs 03 project, because theirs alot of weird settings it activated and the odds of kicking up some vs bug are to scary.

This topic is closed to new replies.

Advertisement