Trying to add LUA to my project

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Trying to add LUA to my project

Postby Habba » Thu Nov 23, 2006 23:30

I'm trying to get started with LUA and CEGUI (using with Ogre), but so far I have been very unsuccesful. I have tried to follow LUA tutorial found from CEGUI wiki, but it's hopelessly unfinished and undetailed.

Currently I'm getting a linker error saying:
Gui.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual class CEGUI::RefPtr<class CEGUI::Event::ConnectionInterface>
__thiscall CEGUI::LuaScriptModule::subscribeEvent(class CEGUI::EventSet *,class CEGUI::String const &,class CEGUI::String const &)" (__imp_?subscribeEvent@LuaScriptModule@CEGUI@@UAE?AV?$RefPtr@VConnectionInterface@Event@CEGUI@@@2@PAVEventSet@2@ABVString@2@1@Z)

I guess that has something to do with my compiler (VC++ 2005) not finding some .lib file, but that's just a guess.

So, I'd like to know what files I need to link, what SDK/etc. to install and paths to add in order to get LUA scripting to work.

I think I have Ogre 1.2, but I'm not so sure about CEGUI version. I tried to update it to 0.5, but I'm not quite sure if it was succesful.
Last edited by Habba on Sun Nov 26, 2006 13:22, edited 1 time in total.

Sjizo
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Thu Aug 31, 2006 08:44

Postby Sjizo » Fri Nov 24, 2006 09:01

Did you include the CEGUILua.lib or CEGUILua_d.lib file into your project. Error looks like a missing lib file

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Fri Nov 24, 2006 10:59

These are the .lib files I currently have included in my debug-verion. Don't really know if all of them are necessarily needed...

OgreMain_d.lib
CEGUIBase_d.lib
OgreGUIRenderer_d.lib
CEGUILua_d.lib
tolua++_d.lib
lua50_d.lib

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Fri Nov 24, 2006 14:44

It looks like an unsuccessful upgrade. most likely your headers and libraries do not match!

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Sun Nov 26, 2006 13:25

lindquist wrote:It looks like an unsuccessful upgrade. most likely your headers and libraries do not match!


I downloaded Ogre SDK 1.2.4 for Visual Studio 8 (=2005) and Cegui Mk-2 Win32 SDKs 0.5.0b, installed both of them and added thos paths into my project directories, but it really didn't do anything.

So... what now then?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sun Nov 26, 2006 15:46

iirc ogre comes with cegui libs and headers. remove these completely. also make sure you recompile the ogre renderer module!

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Sun Nov 26, 2006 16:56

lindquist wrote:also make sure you recompile the ogre renderer module!


Do what to what now...?

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Postby spannerman » Sun Nov 26, 2006 20:31

Habba wrote:
lindquist wrote:also make sure you recompile the ogre renderer module!


Do what to what now...?


There is info on this on the Ogre and Cegui wikis/forums, have a search around.

Ogre has a GuiRenderer that uses Cegui, so when you get the Ogre source package it comes with a version of Cegui's libs and headers etc. Basically you need to make sure you are using the same Cegui that Ogre is using.

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Fri Dec 01, 2006 10:44

Right, I'll summary what's going on now:

1. Downloaded CEGUI 0.5b source package for VC8, along side with the needed dependencies
2. Downloaded Ogre 1.2.4 source package for VC8, along side with the needed dependencies
3. Copied the dependencies folder to Ogre/CEGUI source package folders, respectively
4. Opened the Visual Studio 2005 solution file from ...\CEGUI-0.5.0\makefiles\premake
5. Compiled the solution under Release and Debug settings
6. Updated OGRE to use the latest CEGUI, by following these instructions.
7. Opened the Visual Studio 2005 solution file from ..../ogrenew
8. Compiled the whole solution under Release settings

Now, I'm not quite sure what's the recommend method after this, should I use this folder as my include/lib directory, or should I copy all .h .dll and .lib files under my Ogre/CEGUI SDK directory. I tried to do both, but neither did work (might be that made mistakes there, since it's getting pretty messy after 4-5 days of constantly compiling, installing, copying and moving files.)

Edit: And the error remains unchanged.

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Fri Dec 01, 2006 22:04

It looks like you have followed the steps in the correct order. What is the exact error you are getting now?

Have you tried to get CEGUI and Ogre running without merging them? I mean have you tried to run a cegui sample after compiling, before you copied stuff over to Ogre?

The same for Ogre: did it compile and run before copying new cegui files over? I ask these questions to make sure that both libraries work in their 'pristine' setup.

[EDIT] i had already forgotten the topic ;-) Do Ogre and Cegui work together without the Lua part? [/EDIT]

Good luck!

Habba
Not too shy to talk
Not too shy to talk
Posts: 31
Joined: Tue Sep 19, 2006 15:21
Location: Finland
Contact:

Postby Habba » Sat Dec 02, 2006 10:39

scriptkid wrote:[EDIT] i had already forgotten the topic ;-) Do Ogre and Cegui work together without the Lua part? [/EDIT]


They used to.. but now I see it isn't working anymore. I think I'll remove everything related to Ogre and CEGUI from my computer and reinstall these. Might not be impossible that something got messed up while I tried to update. If you won't hear about me for a while... wait longer, for I'll come back later then. 8) And thanks for support.

By the way, if what I posted is the way to upgrade should be done, I suggest that this information would be put to Wiki, since I had to figure it out myself by Trial & Error.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 13 guests