gpt4 book ai didi

c++ - 如何从 Lua 调用 C++ DLL 中的函数?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:40:43 27 4
gpt4 key购买 nike

我有一个用 C++ 编写的 DLL,它是遗留代码,无法修改源代码。我希望能够从 Lua 调用 DLL 内部的一些函数.

例如,我想做这样的事情:

-- My Lua File
include(myCppDll.dll)

function callCppFunctionFromDll()
local result = myCppFunctionFromDll(arg1, arg2)
--Do something with result here
end

这样的事情可能吗?

最佳答案

关于c++ - 如何从 Lua 调用 C++ DLL 中的函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2835716/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com