Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problems with lua libraries in VS 2015

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source -> Plugin development
View previous topic :: View next topic  
Author Message
CodeReaver
Newbie cheater
Reputation: 0

Joined: 19 Apr 2005
Posts: 24

PostPosted: Thu Sep 15, 2016 9:22 am    Post subject: Problems with lua libraries in VS 2015 Reply with quote

I'm writing a plugin using Visual Studio 2015 and since I want to be thorough, I'm supporting the 32 bit version as well as the 64 bit.

Dark Byte told me that current versions of Cheat Engine use lua 5.3 and gave me an example that included lua53-64, but when I tried to use the 32 bit counterpart from CE's GitHub page, Visual Studio tells me I'm compiling with the 64 bit library with my 32 bit project configuration. I might need to double check that's not just a mistake in my pragma comments, although I'm pretty sure I did that already. I think there was also an error that said the library was built with a different version of VS.

As an attempt at solution, I grabbed the latest binaries from lua's official website and made sure it was a version that best matched my VS version. In order to check it really was correct, I tried using the 64 bit library from the lua site, but when I do that, the plugin stops working and I get an access violation as soon as the plugin tries using lua.

Can anyone tell me what I might be doing wrong?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 326

Joined: 09 May 2003
Posts: 19363
Location: The netherlands

PostPosted: Thu Sep 15, 2016 9:34 am    Post subject: Reply with quote

hmm. that lib should have worked

for compiling it yourself, try https://github.com/cheat-engine/cheat-engine/tree/master/Cheat%20Engine/lua53/lua53/vs2013/lua53 (just the library)



don't static link, but use the dll

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
CodeReaver
Newbie cheater
Reputation: 0

Joined: 19 Apr 2005
Posts: 24

PostPosted: Thu Sep 15, 2016 10:24 am    Post subject: Reply with quote

Dark Byte wrote:
hmm. that lib should have worked

for compiling it yourself, try https://github.com/cheat-engine/cheat-engine/tree/master/Cheat%20Engine/lua53/lua53/vs2013/lua53 (just the library)



don't static link, but use the dll


Are those two separate things to try?

I guess if I paste the dlls into my own project to reference that would make things easier for anyone trying to build from the source code, and then of course there's be no need to paste back to the plugins folder as CE will already have loaded them. I'm trying to avoid absolute paths so people can compile without having to update the references.

The lua project was built with VS 2013, and I definitely saw some error mentioning versions of VS. Maybe I just need to grab that project and upgrade it to VS 2015.

BTW, do my findings in that thread about the linker address map sound correct to you? (The part about the table object not being exposed to Lua.) Would exposing FindNextSymbolFromBase to lua be something you could do in future? I mean as a member of that symbollist class I'd been working with.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 326

Joined: 09 May 2003
Posts: 19363
Location: The netherlands

PostPosted: Thu Sep 15, 2016 10:59 am    Post subject: Reply with quote

Just make sure you do not rename the .dll files. The dll's initialize some data like critical sections, and renaming them will cause them to be loaded standalone again.
The same reason why you should not embed the lua code inside your plugin, but use a dynamic link approach

(In worst case scenario, you can always look up the address of the used lua library and use getprocaddress to get the exports...)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
CodeReaver
Newbie cheater
Reputation: 0

Joined: 19 Apr 2005
Posts: 24

PostPosted: Sat Sep 17, 2016 5:23 pm    Post subject: Reply with quote

Thanks DarkByte, that worked great! I don't think I even need to tell VS where the dlls are as long as the import libs are there. It seems to find them without any problem once I copy the plugin to CE's folder. I'm pretty certain these are just linking information now, as they got much smaller once I downloaded the project.

I got myself a GitHub account in the process, which I'd been meaning to do for a while.

I'll host the project there, since I think it would be a useful example to have for VS 2015.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source -> Plugin development All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites