• Advertisement
Sign in to follow this  

compilling Lua with C++ ???

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

HI! i am with a problem! how to compilling lua with c++ on linux??? it is? : g++ demo.cpp -o demo -llua -lliblua -lm help-me

Share this post


Link to post
Share on other sites
Advertisement
-llua50 and -llualib50 (or 51, if you use 5.1).

Sorry, I forgot that the names changed.

Share this post


Link to post
Share on other sites
Also try -ldl. I think it is required when you are linking dynamic lua libs.

Share this post


Link to post
Share on other sites
If you're compiling in C++ instead of C, you need to do extern "C" around the includes.

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

Share this post


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

  • Advertisement