ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Thu Nov 22, 2018 10:33 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Mar 13, 2016 7:55 am 
Offline

Joined: Sun Mar 13, 2016 7:42 am
Posts: 2
I made a test.dll with Luabind, but T-engine is crash down.
I tested Lua51.exe, in this case, Lua51.exe did not crash, and very well done my dll.

can I use other library(dll file) in Lua script called by T-engine?

==== source code of test.dll =========
#include <iostream>
#include <luabind/luabind.hpp>
void greet()
{
std::cout << "hello world!\n";
}
extern "C" int __declspec(dllexport) initMyTest(lua_State* L)
{
using namespace luabind;
open(L);
module(L)
[
def("greet", &greet)
];
return 0;
}
=================


and call it in lua script
====== test.lua =====
function myTest()
package.loadlib("test.dll", "initMyTest")() <== crash down
greet()
end
=================


Top
 Profile  
 
PostPosted: Sun Mar 13, 2016 12:34 pm 
Offline
Thalore

Joined: Mon Mar 25, 2013 10:09 pm
Posts: 153
ToME uses LuaJIT, not Lua 5.1. I don't know if the two are ABI-compatible on Windows, but I don't think they are, so that may be the source of your problem.

_________________
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.


Top
 Profile  
 
PostPosted: Sun Mar 13, 2016 12:54 pm 
Offline

Joined: Sun Mar 13, 2016 7:42 am
Posts: 2
Castler wrote:
ToME uses LuaJIT, not Lua 5.1. I don't know if the two are ABI-compatible on Windows, but I don't think they are, so that may be the source of your problem.

Thank you, it's very useful help. :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group