Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Saintly

LUA - PLEEEESE help :P

This topic is 6303 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

I read through the Lua docs and found that it''d be a good programming lang to use in a game I do in my spare time ... buut ... The precompiled libs for VC6 won''t link properly (Like, no functions exist in the libs ;P. All unresolved externals). Sooo ... I''m in need of help here.. Either someone who''s smart enough to recompile libraries for VC6 using the source. (I aint into putting libs together from their source dist, I stick with programming libs from scratch in winblows ) ...or someone who can tell me how to use the precompiled libs found on the Lua page. I''ve tried most everything, but it wont work. C''mon you guys ..

Share this post


Link to post
Share on other sites
Advertisement
Did you include the libraries in your project?
And do you have a path to point to where they''re at?
Tools->Options->Directories->Libraries...

#pragma comment(lib, "lua.lib")


Magmai Kai Holmlor
- Not For Rent

Share this post


Link to post
Share on other sites
I had a similar problem with that. For some reason, compiling with the .c or .cpp extension makes a difference. You can include just fine if you compile your main as main.c, or if you rename the lua files to have a .cpp extension.

Share this post


Link to post
Share on other sites
Dog_Food is on the right track. C++ and C have different name decoration techniques that are used by the compiler to distinguish between, for example
int func(void)
and
int func(int a)

What you probably need to do is tell the compiler that the LUA header files are for C functions. You do it like this:

extern "C"
{
#include "lua.h"
}

Anything that you declare as extern "C" will use C naming rules. It sounds like this is probably your problem, although I can''t be 100% sure because I''ve never used LUA.

Hope that helps!

Share this post


Link to post
Share on other sites
D''uh! ... I bet I read just that thing somewhere in the LUA example files .

How could I forget that ... Guess I''ve been too sleepy after work these days .

Thanks, I''ll try this once I git home. If it doesn''t work, I''ll come back and whine some more .

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!