Jump to content
  • Advertisement
Sign in to follow this  
pnroach

ok, so what now?

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

so I now have Lua dll and lib . I shoved it in the project and tried to do something. but guess what? it doesn't work. I have 5.02 Lua version and i tried this in my code : extern "C" { #include <lua.h> } #include <assert.h> int main() { lua_State* luaVM = lua_open(); assert(luaVM); luaopen_base(luaVM); lua_close(luaVM); return 1; } My compiler doesn't agree with me and says that it knows nothing of "luaopen_base". So what's wrong? Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I compiled the lib and included it in a project, but my compiler complains about unresolved external symbols. I put the .lib in VS6's lib and used

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

I'm pretty sure that's the right way to include a library, but since lua is in C maybe I'm doing something wrong?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I mean in VS6's lib directory. I've done it before and know that it works, but I screwed up somewhere with Lua.

Share this post


Link to post
Share on other sites
Moved to For Beginners

Know your compiler/IDE. There are two steps to employing a static import library (.lib):
  1. Ensure that the .lib file is in a directory specified in your environment library path. In Visual Studio 6, this is in the Tools->Options...->Directories tab, under the Libraries drop down. You don't have to copy every file into your existing VS6 directories, as that leads to an inability to cleanly separate - and sometimes upgrade - third-party libraries.

  2. Properly link the file in. While the use of #pragma comment(lib "<libname>") works on Visual Studio, it is not necessarily portable, nor is it a clean solution. The best option is to go into your Project Settings dialog, under the C/C++ tab and the Input selection and specific the library name in the Libraries textarea.


Finally, learn to love documentation. Every time your compiler spits out an error, it provides an accompanying error number - C4086, LNK2001, etc. For Visual Studio, you can look these error numbers up in MSDN (if you have a local installation in VS6, you can simply select the error code and press F1; in VS7 and above, you can configure the IDE to connect to MSDN online to retrieve detailed information). The MSDN entries explain the error, provide samples of causes, and detailed instructions on solutions.

Happy hacking!

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!