Jump to content
  • Advertisement
Sign in to follow this  
Errornix

Lua with Visual Studio

This topic is 4952 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 just downloaded an open source project that uses Lua and I can't get it to compile because I don't have Lua set up on my computer. I tried checking lua.org and google but neither one was much help. I'm trying to compile the project using Visual Studio.NET. Can anybody here help me get Lua set up properly? If it helps, the error message that I get is "Cannot open include file: 'lauxlib.h'".

Share this post


Link to post
Share on other sites
Advertisement
I'm sorry but that's nothing to do with VS or LUA, you just haven't got your paths set up properly so that the project can find the appropriate headers (or you just don't have them)

Share this post


Link to post
Share on other sites
When I dl Lua, do I need to actually compile it, or do I just need to set my paths correctly to include the Lua files?

Share this post


Link to post
Share on other sites
I'm not sure if you're using C#/.NET, but here's what I have done with C++ (although I'm using Dev-C++, I do also have the commandline MSVC 2003 .NET, so I know that it's the same).

Downloaded luaxlib.h, lua.h, lualib.h and placed them in the include folder.
Downloaded lua-5.0.lib and lualib-5.0.lib and placed them in the lib folder.
Downloaded lua-5.0.dll and lualib-5.0.dll plus lua.exe and luac.exe (for compilation to bytecode for faster loading) and placed them in the C:\WINDOWS directory (any directory included in the enviroment paths will do fine, like C:\WINDOWS\system32), but you also need to include them with your program if you distribute it since the end users probably don't have it.

After that, Lua worked perfectly, and I haven't had any problems with the paths (yet :-P).

Your error "cannot open include file: 'lauxlib.h'" sounds like you're not placing the files correctly in the include folder (you cannot placed them in a subfolder and then use #include <lua.h> unless the path is predefined in the project options).

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.

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!