Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / LUA Problem

Author
Message
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 24th Dec 2009 07:49
Hello i am using Barnski's Lua Plugin to get LUA working in my dark gdk project. I have found example code but i canot seem to get it working. Here is my code



Here are my errors



i can get it to work by going



But then i run into trouble later and i cant get my num=lua::get_int("alter"); working. I have included it in my additional dependencies. Any ideas on what i may be doing wrong? Thanks for any help i recieve.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Dec 2009 09:02 Edited at: 24th Dec 2009 09:02
Hi Marsh0, I ended up writing my own wrapper DarkLUA after I ran into trouble registering functions with Barnksi's wrapper. But I did get to work using advice from Sweemoo posted below. Original Thread found here.

Quote: "first you have to include the directories for the files that came with Barnski's Library. The Lib file for the Lib Directories and Include for the header. Then set your Project to use Barnski'sLuaPlugin_debug.lib as an additional dependency"




then in your Lua file (filename.file) you can just put



Cuddle Bunniezzz 12
15
Years of Service
User Offline
Joined: 14th Jan 2009
Location: Buffalo, NY
Posted: 24th Dec 2009 16:08
Question:

Where do you put "Barnski'sLuaPlugin_debug.lib"? I've been having a little trouble trying to get this LUA plugin working in my programs.

http://www.darkgdk.us/ <- You can now submit pages, upload images, yet were lacking content. We need your help!
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 24th Dec 2009 18:15
I saw that post techlord and tried to follow it.

As i said in my first post i added the addiotonal depencies as for this part:

Quote: "
first you have to include the directories for the files that came with Barnski's Library
"


No directories came with my download just the lib and the .h which is in the same directory as my program.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 25th Dec 2009 10:22
Barnski'sLuaPlugin_debug.lib goes --> {DGDK Path}/Lib/vs9 Directory

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 25th Dec 2009 10:41
Ah, thanks for that. Though once i copied that file over i am still receiving the same errors. Anything else that may be the problem?
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 25th Dec 2009 11:10 Edited at: 25th Dec 2009 11:11
lua_plugin.h goes -> {DGDK Path}/Include/

Whats this:


binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 25th Dec 2009 18:58
Why even use this plugin if your using c++... Just use real lua, thats what i am doing and itss wayyy more flexible.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 25th Dec 2009 19:48
Quote: "lua_plugin.h goes -> {DGDK Path}/Include/"


Yes i already did that also, thought that code may help. Doesnt make a difference if its there or not. If i cannot get this working i may just do that binsky but i would prefer not to.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 26th Dec 2009 02:16
Quote: "If i cannot get this working i may just do that binsky but i would prefer not to. "
Sorry Marsh0, I cannot be of more assistance. I've deleted the plug-in months ago so I cannot view duplicate the issue. You have to proceed with binsky.

Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 26th Dec 2009 02:59
Alright thanks for helping
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 26th Dec 2009 17:47
As you said earlier you have it included in your additional dependencies correct? You have this typed in:

Barnski'sLuaPlugin_debug.lib

Also you have the .lib in your lib folder in the DARKGDK directory?

Last thing i have to say is try this...
1.Open up your project properties
2.Go to the C/C++ part
3.Go to Code Generation
4.Look for the runtime library option and change it to Multi-threaded (/MT) instead of Multi-threaded Debug (/MTd)

Try those things and get back to me!
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 26th Dec 2009 19:18 Edited at: 26th Dec 2009 19:19
All those settings are already like that binsky. Not sure what i am doing wrong here. I am using a 64 bit version of windows if that makes a difference windows 7.

Thanks for the help
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 26th Dec 2009 21:02
So here is the code snippet you supplied us with.


First... try getting rid of the #pragma comment (lib,"Barnski'sLuaPlugin_debug.lib") line. Then after that i see you have lua::make();... Instead just try lua make(), and do that for the rest with :: . Im not home now, but when i get home ill see if i can get it compiling.
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 27th Dec 2009 01:21
Still get the same errors.
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 27th Dec 2009 02:24
I did almost the same exact thing you did in your first post... It compiled fine and worked. I've included my source as an example so you can open up, test it and see if it compiles on your machine. All this example does it initialize lua, and load the variable var from the lua file and then display its value.

Attachments

Login to view attachments
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 27th Dec 2009 03:27
Your example works fine, though i check my project settings and cannot see why mine wont work. I cant integrate it into my current project at all. Could it have something to do with the other headers?
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 27th Dec 2009 05:42
It could possibly be the headers, i was working on another project and the other headers were causing a lot of errors. Make sure that all of your other headers are placed before #include "DarkGdk.h", and also if you are using namespace std;, declare that before DarkGdk.h, Also make sure your runtime library is set to Multi-threaded (/MT), which you said you have already done. Last but not least, how did you create your current project... Did you just create a win32 app, or did you use one of the Darkgdk Game Template Wizards?
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 27th Dec 2009 07:17
I put the headers before my darkGDK.h i created my project through the dark GDK template wizard originally. Though this project has been copied over a reformat not sure if anything would have changed.

Here are my headers.

// Normal
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include "MikeNet.h"
#include "lua_plugin.h"

using namespace std;

// Dark GDK
#include "DarkGDK.h"
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 27th Dec 2009 18:39
Now, do you get the errors when you add the header file, or when you use the commands?
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 28th Dec 2009 00:50
When i use the commands
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 28th Dec 2009 01:54
If you want... I could take a look at the source code?
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 28th Dec 2009 04:56
Do you have somewhere i can email it to you? i really dont want people getting ahold of it.
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 28th Dec 2009 16:23
Yea, just hit me up at binsky3333@verizon.net
Marsh0
15
Years of Service
User Offline
Joined: 18th Mar 2009
Location:
Posted: 28th Dec 2009 19:59 Edited at: 29th Dec 2009 00:33
Email sent , thanks.

[Edit]

He got it working flawlessly , thanks again.

Login to post a reply

Server time is: 2024-10-01 20:23:40
Your offset time is: 2024-10-01 20:23:40