Jump to content

  • Log In with Google      Sign In   
  • Create Account


Anyone had any luck compiling LUA?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Kylotan   Moderators   -  Reputation: 3329

Like
Likes
Like

Posted 19 January 2002 - 02:08 PM

First I tried compiling the source into a lua.lib, which appeared to work. Then in another project I linked with this, #included "lua.h", and it complained of missing objects at link time (lua_open, lua_close, etc). I think it''s because I am compiling the lib wrongly. Any clues as to what I''m missing or doing wrongly? [ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Sponsor:

#2 Destroyer   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 January 2002 - 02:21 PM

Hi,

I could be VERY wrong on this, but I believe that when you compile a .lib file that there''s a seperate .dll compiled along with it, this is where I think I''m very wrong. But if this is the case - make sure that the DLL is in the same location as the program.

Eh - well I tried...

Hope it helps!

Eric

//----------------------------
In a world without boundaries -
who needs gates or windows ?
----------------------------\\


#3 Kwizatz   GDNet+   -  Reputation: 1182

Like
Likes
Like

Posted 19 January 2002 - 02:50 PM

did you added your lua.lib to your libraries (path and all) ? you can also add the file to your project in VC++.

C++ name mangling comes to mind, but thats a problem only if you use LoadLibrary() to load a DLL



#4 Kylotan   Moderators   -  Reputation: 3329

Like
Likes
Like

Posted 19 January 2002 - 03:22 PM

Yes, it's added to the library path, and no, there shouldn't need to be a DLL (as I want to link staticly, not dynamically). I might try adding it to the project to see what that does.

Update: I added it to the project and it made no difference. Still 3 "unresolved external symbol" errors, for lua_close, lua_dostring, and lua_open. I reckon the .lib file isn't 'working'. I changed the #define that modifies all the API calls:
from
#define LUA_API extern
to
#define LUA_API __declspec(dllimport)

in the hope that it might make a difference, but it doesn't seem to. Any clues on how I can check if the .LIB is somehow incomplete? I admit to being a newbie as far as making static libraries is concerned.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

Edited by - Kylotan on January 19, 2002 10:29:27 PM

Edited by - Kylotan on January 19, 2002 10:30:43 PM

#5 Oluseyi   Staff Emeritus   -  Reputation: 1670

Like
Likes
Like

Posted 19 January 2002 - 03:32 PM

Just off the cuff, did you search through the LUA source to make sure the lua_open(), lua_close() and lua_dostring() functions were actually defined anywhere? For static libs, this is the most reasonable thing I can think of.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!


#6 Oluseyi   Staff Emeritus   -  Reputation: 1670

Like
Likes
Like

Posted 19 January 2002 - 03:33 PM

Oh, and you definitely don''t want to use declspec(dllimport)!

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!


#7 Kylotan   Moderators   -  Reputation: 3329

Like
Likes
Like

Posted 20 January 2002 - 02:50 AM

Yeah, the functions are declared, and are definitely getting compiled. I can''t be sure they''re going into the .LIB though, cos I know nothing about lib making. Having said that, the lib is over 300k in size, so something is going in

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]

#8 Kylotan   Moderators   -  Reputation: 3329

Like
Likes
Like

Posted 23 January 2002 - 08:06 AM

It was a stupid error: I forgot to enclose #include "lua.h" in an ''extern "C"'' block, so it was looking for C++ symbol names when the library contained C symbol names. Duh. I guess it shows that I am not used to interfacing the two languages. Shame they don''t have an #ifdef __cplusplus bit inside the header already, though.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost ]




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS