Embedding Lua in Visual C++ 2008

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

i have the .lib files now but also a dll not a static linked library
User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

You know what? I'm going to clear my computer of anything that has to do with lua and start all over again... Now if someone could write a short and sweet guide on how they installed it, or show me where they learned to, that would be great. For now I am going to download Lua 5.1.4 source code.
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Embedding Lua in Visual C++ 2008

Post by avansc »

Cole S. wrote:You know what? I'm going to clear my computer of anything that has to do with lua and start all over again... Now if someone could write a short and sweet guide on how they installed it, or show me where they learned to, that would be great. For now I am going to download Lua 5.1.4 source code.
did you just ask a rhetorical question?
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

Lol, I had to look up the definition for rhetorical (i'm 13) but yeah i kind of am!
User avatar
cypher1554R
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1124
Joined: Sun Jun 22, 2008 5:06 pm

Re: Embedding Lua in Visual C++ 2008

Post by cypher1554R »

Cole S. wrote:For now I am going to download Lua 5.1.4 source code.
Really? That could have been your problem. If you intend to just use Lua, then you should get the bin package.
User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

can i redistribute the bin package?
User avatar
PixelP
Chaos Rift Regular
Chaos Rift Regular
Posts: 153
Joined: Tue Oct 07, 2008 12:23 pm
Programming Language of Choice: c/c++
Location: sweden
Contact:

Re: Embedding Lua in Visual C++ 2008

Post by PixelP »

User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

i downloaded a binary but now when i try to run a sample script i get a blank line in the exe, here is the code:

#include <iostream>

using namespace std;
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

int main()
{
lua_State *L = lua_open();

// load the libs
luaL_openlibs(L);

//run a Lua script here
luaL_dofile(L,"hello.lua");

lua_close(L);

return 0;
}
User avatar
avansc
Respected Programmer
Respected Programmer
Posts: 1708
Joined: Sun Nov 02, 2008 6:29 pm

Re: Embedding Lua in Visual C++ 2008

Post by avansc »

i seriously dont know why this is even a thread.
Some person, "I have a black belt in karate"
Dad, "Yea well I have a fan belt in street fighting"
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Embedding Lua in Visual C++ 2008

Post by MarauderIIC »

Cole, use the [code] and [/code] tags, would you? As for lua, it's not something I can help you with, besides, um, does your .lua file that you do there, does it actually, yknow, print?
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: Embedding Lua in Visual C++ 2008

Post by Falco Girgis »

We can't help you if we don't have the source of the lua test file. For all we know, it's doing its thang.
User avatar
Cole S.
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 59
Joined: Sat Dec 06, 2008 2:49 pm

Re: Embedding Lua in Visual C++ 2008

Post by Cole S. »

Thx for the help u guys it's working now. :)
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: Embedding Lua in Visual C++ 2008

Post by MarauderIIC »

Glad you got it working.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Post Reply