Jump to content
  • Advertisement
Sign in to follow this  
mattnenterprise

Lua

This topic is 3589 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 am using lua and this simple program won't work it looks like this. #include <stdio.h> extern "C" { #include "lua.h" #include "lstate.h" #include "lauxlib.h" } int main(int argc, char* argv[ ]) { lua_State * l = luaL_newstate(); lua_close(l); return 0; } and I get errors that say [Linker error] undefined reference to `luaL_newstate' [Linker error] undefined reference to `lua_close' I don't know what is wrong

Share this post


Link to post
Share on other sites
Advertisement
You have to link to the Lua library (usually lua.<version>.lib or lua.<version>.a). What IDE/toolchain are you using?

Share this post


Link to post
Share on other sites
Usually in the compiler options you find a panel that let you specify which libs you want your project to be linked to. Since you're using Dev-C++ i suppose that the compiler is gcc and IIRC you need th .a libraries.
Just make sure that your lib files are in one of the lib directories. All this is IDE dependant, so you must check in the documentation how to do that in Dev-C++ (I haven't used it for years)...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!