Sign in to follow this  

Lua static-linked woes

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Wow thx for help... release mode does fix problem. I'll be going to dll now since still need debug mode :P

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this