Lua Question
Moderator: Coders of Rage
- Lord Pingas
- Chaos Rift Regular
- Posts: 178
- Joined: Thu Dec 31, 2009 9:33 am
- Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
- Programming Language of Choice: C++
- Location: Hiding In My Mum's Basement With My Pokemon Cards
Lua Question
Hello fellow game developers.
I'm working on this engine which is pretty good so far and it's going pretty well and I am trying to implement Lua.
The problem is that I'm using Code::Blocks and I have linked the includes and libs and everything but I keep getting "undefined reference" errors and I have googled and googled but I found nothing.
I have also included my lua files with extern "C".
Do you guys have any ideas on why this problem would occur, other than i'm stupid.
Also there is nothing wrong with my code, I've researched and it all looks fine to me.
I'm working on this engine which is pretty good so far and it's going pretty well and I am trying to implement Lua.
The problem is that I'm using Code::Blocks and I have linked the includes and libs and everything but I keep getting "undefined reference" errors and I have googled and googled but I found nothing.
I have also included my lua files with extern "C".
Do you guys have any ideas on why this problem would occur, other than i'm stupid.
Also there is nothing wrong with my code, I've researched and it all looks fine to me.
- Zer0XoL
- ES Beta Backer
- Posts: 54
- Joined: Fri Apr 24, 2009 1:18 pm
- Current Project: Zelda untitled multiplayer game
- Favorite Gaming Platforms: PC, GBA, N64
- Programming Language of Choice: C++, Lua
- Location: Sweden
- Contact:
Re: Lua Question
I may not know, try compiling the libraries for the compiler you are using or try getting the right libraries, i use luabind, are you using plain lua? I may know no further :PLord Pingas wrote:Hello fellow game developers.
I'm working on this engine which is pretty good so far and it's going pretty well and I am trying to implement Lua.
The problem is that I'm using Code::Blocks and I have linked the includes and libs and everything but I keep getting "undefined reference" errors and I have googled and googled but I found nothing.
I have also included my lua files with extern "C".
Do you guys have any ideas on why this problem would occur, other than i'm stupid.
Also there is nothing wrong with my code, I've researched and it all looks fine to me.
- Lord Pingas
- Chaos Rift Regular
- Posts: 178
- Joined: Thu Dec 31, 2009 9:33 am
- Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
- Programming Language of Choice: C++
- Location: Hiding In My Mum's Basement With My Pokemon Cards
Re: Lua Question
I'm not using luabind or any binding libraries, I'm just new to lua and I want to implement them to the engine I once had before I decided to rewrite it so it can be, well, more like an engine.
How would I set up lua correctly to Code::Blocks?
Oh and I'm so sorry for the very late reply, I completely forgot about this post.
How would I set up lua correctly to Code::Blocks?
Oh and I'm so sorry for the very late reply, I completely forgot about this post.
-
- ES Beta Backer
- Posts: 10
- Joined: Wed Jul 21, 2010 2:40 am
- Favorite Gaming Platforms: PS2, PC, NES
- Programming Language of Choice: C++, AS3
Re: Lua Question
Hmm I don't know much about Code::Blocks but this site helped me implement Lua scripts into my engine maybe it can help you. http://gamedevgeek.com/tutorials/gettin ... d-with-lua
- WSPSNIPER
- Chaos Rift Regular
- Posts: 145
- Joined: Sun Jan 03, 2010 6:19 pm
- Current Project: top down shooter
- Favorite Gaming Platforms: ps3
- Programming Language of Choice: c++
Re: Lua Question
usually lua comes with .lib files which codeblocks can't use so create a new static lib project and add the lua files to it and build it. then link the lib you just built. make sure to build it in relaease... actually idk if it matters but that's what I did. you should get the file liblua.a and you link it with -llua
Re: Lua Question
Generally an undefined reference has to do with incorrect linking so your code may be correct but you didn't specify the paths to link to the libraries.
- MrDeathNote
- ES Beta Backer
- Posts: 594
- Joined: Sun Oct 11, 2009 9:57 am
- Current Project: cocos2d-x project
- Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
- Programming Language of Choice: C/++
- Location: Belfast, Ireland
- Contact:
Re: Lua Question
Thats a very nice tut, thanks i've bookmarked it for laterGRENADIAC111 wrote:Hmm I don't know much about Code::Blocks but this site helped me implement Lua scripts into my engine maybe it can help you. http://gamedevgeek.com/tutorials/gettin ... d-with-lua
http://www.youtube.com/user/MrDeathNote1988
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Lua Question
Yeah that's what I used when I first set up Lua. Practically the only decent one available. Definitely worthy of posting.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- Falco Girgis
- 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: Lua Question
You're DEFINITELY not linking to the library correctly.
- Lord Pingas
- Chaos Rift Regular
- Posts: 178
- Joined: Thu Dec 31, 2009 9:33 am
- Favorite Gaming Platforms: NES, SNES, Nintendo 64, Dreamcast, Wii
- Programming Language of Choice: C++
- Location: Hiding In My Mum's Basement With My Pokemon Cards
Re: Lua Question
Nah it's fine now.
I just compiled Lua myself into a .a file rather than a .lib and it's working fine.
Thanks guys.
I just compiled Lua myself into a .a file rather than a .lib and it's working fine.
Thanks guys.