当尝试从Lua模块调用C函数时,使用Lua通道,控件不会转移到'C‘函数。有什么问题,Lua-车道将不会以线程的方式与外部C dll?
下面是代码片段
Lua片段:
lanes.gen("*",func)
thread = func()
thread:join()
function func()
foo() -- expected to print "Hello world", by
-- calling below C function,but not happening
end
编译成具有VS-2012的dll的代码片
我不明白如何使用CMake (3.11)在Windows上使用VS 2017定位Lua5.3.4的动态版本。我将CMAKE_PREFIX_PATH设置为指向具有include\lua.h和lib\lua53.dll的目录。这些是CMakeLists.txt中的相关行
if(NOT DEFINED LUA_INCLUDE_DIR OR NOT DEFINED LUA_LIBRARIES)
find_package(lua REQUIRED)
endif()
include_directories(${LUA_INCLUDE_DIR})
target_link_libraries(${PR
我下载了mysql-async,essentialmode,esplugin_mysql,es_admin2,async,它显示了这个错误。 是关于什么的?请帮助我,我正在尝试创建我的服务器。 [ERROR] connect ETIMEDOUT
Connecting: kworthbati
Sending heartbeat to live-internal.fivem.net:30110
[ERROR] [MySQL] [esplugin_mysql] An error happens on MySQL for query
"SELECT
我对Lua很陌生。我使用将一个JS文件编译为Lua5.2
castl -o script.js
这创建了一个名为script.js.lua.的文件这是我的新lua文件的第一行:
local _ENV = require("castl.runtime");
我试着用lua52 script.js.lua运行该文件,但是我得到了以下错误:
C:\Program Files\lua-5.2.4_Win64_bin\lua52.exe: script.js.lua:1: module 'castl.runtime' not found:
no field
我想在visual studio下编译Lua 5.2 alpha,但我收到了错误,而且我不知道如何修复它们。
error LNK1169: one or more multiply defined symbols found
error LNK2005: _main already defined in lua.obj
如果有人能指导我为Lua5.2alpha创建VS2010解决方案,或者给我提供相关的参考资料,我将不胜感激。
提前谢谢。
基本上有另一个fivem es_extended问题,我得到了不受欢迎的错误,每次用户尝试加入我的服务器,并显示他们的钱未定义,也不允许他们保存他们的衣服。 我已经从我的数据库中删除了表,并重新添加了它们,但没有用。 stack traceback:
@es_extended/server/main.lua:155: in upvalue 'ref'
citizen:/scripting/lua/scheduler.lua:391: in function <citizen:/scripting/lua/scheduler.lua:390
我使用"lua.vm.js“在web客户端使用lua进行开发。
我想知道如何从js脚本调用Lua函数。
var element = document.getElementById("myBtn")
element.addEventListener("click", function(){ /*call here Lua function*/ });
我正在尝试让Lua系统在我的.NET 4.0应用程序中工作。我使用LuaInterface作为Lua的包装器,它是在.NET 4.0下编译的
在我的安装了VS2010的开发计算机上运行Lua脚本时,应用程序运行得非常好。但是当在另一台计算机上运行它时,我得到了一个FileNotFoundException。
System.IO.FileNotFoundException: Could not load file or assembly 'lua51.dll' or one of its dependencies. The specified module could not b
假设我们有以下函数定义
int function_wrapper_dummy( lua_State* ) { }
template < typename F, F* f >
int function_wrapper( lua_State* L ) { }
和下面的函数
template < typename F >
void register_function( F f )
{
int (*lf) (lua_State *L) = function_wrapper_dummy; // line 1
int (*lf) (lua_State *L)
最近,我成为了我的团队中的Lua专家,因为当我们想将一个大表发送到以下功能时,会出现一个问题:
int native_sl_shootlaserpulse(lua_State* L)
{
int iRetVal = 0;
// L1 is class instance
luaL_checktype(L, 2, LUA_TTABLE);
double jumpSpeed = luaL_checknumber(L, 3);
double settleTime = luaL_checknumber(L, 4);
unsigned int nu
我注意到一个严重的性能问题,我引入了一个c++对象作为lua函数arg。
function luaFunc(someString)
print someString
end
这是相当快-不到30毫秒的100k电话。
现在,我添加了另一个对象
function luaFunc(myCObj, someString)
print somestring
myCObj:doStuff()
end
100k呼叫现在占用1秒以上。(添加另一个原语,如int或string作为arg没有性能影响!此外,将对象放入全局范围(例如,不要每次将其作为func推送,也没有性能影响--但我需要它作为参数)。
这是