BUG - ProteaAudio 与 Lua 不起作用

发布于 2024-10-09 08:26:43 字数 1760 浏览 7 评论 0原文

知道为什么我不能使用或不能在 Lua 中构建 ProTeaAudio 吗?

1) 存在

[root@example ~]# yum install lua-devel
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package lua-devel-5.1.4-4.fc12.i686 already installed and latest version
Nothing to do

2) 构建 RtAudio 失败

[sun@example proteaAudio_src_090204]$ make
g++ -O2 -Wall  -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__  -Irtaudio -Irtaudio/include -I../lua/src -I../archive/baseCode/include -c rtaudio/RtAudio.cpp -o rtaudio/RtAudio.o
rtaudio/RtAudio.cpp:365: error: no ‘unsigned int RtApi::getStreamSampleRate()’ member function declared in class ‘RtApi’
rtaudio/RtAudio.cpp: In member function ‘virtual bool RtApiAlsa::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, RtAudioFormat, unsigned int*, RtAudio::StreamOptions*)’:
rtaudio/RtAudio.cpp:5835: error: ‘RTAUDIO_SCHEDULE_REALTIME’ was not declared in this scope
rtaudio/RtAudio.cpp:5837: error: ‘struct RtAudio::StreamOptions’ has no member named ‘priority’
make: *** [rtaudio/RtAudio.o] Error 1
[sun@example proteaAudio_src_090204]$ 


Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require("proAudioRt");
    stdin:1: module 'proAudioRt' not found:
     no field package.preload['proAudioRt']
     no file './proAudioRt.lua'
     no file '/usr/share/lua/5.1/proAudioRt.lua'
     no file '/usr/share/lua/5.1/proAudioRt/init.lua'
     no file '/usr/lib/lua/5.1/proAudioRt.lua'
     no file '/usr/lib/lua/5.1/proAudioRt/init.lua'
     no file './proAudioRt.so'
     no file '/usr/lib/lua/5.1/proAudioRt.so'
     no file '/usr/lib/lua/5.1/loadall.so'
    stack traceback:
     [C]: in function 'require'
     stdin:1: in main chunk
     [C]: ?

Any idea why i cant use or cant build in Lua the ProTeaAudio ?

1) Exist

[root@example ~]# yum install lua-devel
Loaded plugins: presto, refresh-packagekit
Setting up Install Process
Package lua-devel-5.1.4-4.fc12.i686 already installed and latest version
Nothing to do

2) get failed to build the RtAudio

[sun@example proteaAudio_src_090204]$ make
g++ -O2 -Wall  -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__  -Irtaudio -Irtaudio/include -I../lua/src -I../archive/baseCode/include -c rtaudio/RtAudio.cpp -o rtaudio/RtAudio.o
rtaudio/RtAudio.cpp:365: error: no ‘unsigned int RtApi::getStreamSampleRate()’ member function declared in class ‘RtApi’
rtaudio/RtAudio.cpp: In member function ‘virtual bool RtApiAlsa::probeDeviceOpen(unsigned int, RtApi::StreamMode, unsigned int, unsigned int, unsigned int, RtAudioFormat, unsigned int*, RtAudio::StreamOptions*)’:
rtaudio/RtAudio.cpp:5835: error: ‘RTAUDIO_SCHEDULE_REALTIME’ was not declared in this scope
rtaudio/RtAudio.cpp:5837: error: ‘struct RtAudio::StreamOptions’ has no member named ‘priority’
make: *** [rtaudio/RtAudio.o] Error 1
[sun@example proteaAudio_src_090204]$ 


Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require("proAudioRt");
    stdin:1: module 'proAudioRt' not found:
     no field package.preload['proAudioRt']
     no file './proAudioRt.lua'
     no file '/usr/share/lua/5.1/proAudioRt.lua'
     no file '/usr/share/lua/5.1/proAudioRt/init.lua'
     no file '/usr/lib/lua/5.1/proAudioRt.lua'
     no file '/usr/lib/lua/5.1/proAudioRt/init.lua'
     no file './proAudioRt.so'
     no file '/usr/lib/lua/5.1/proAudioRt.so'
     no file '/usr/lib/lua/5.1/loadall.so'
    stack traceback:
     [C]: in function 'require'
     stdin:1: in main chunk
     [C]: ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

偏闹i 2024-10-16 08:26:43

Lua 试图告诉您它无法找到它试图在各个地方找到的模块 "proAudioRt" 的实现。第一块地方是在 Lua 中加载实现的各种尝试,然后是对可能包含该模块的各种共享对象文件的一些尝试。由于这些地方都不起作用,require 失败。

没有一个起作用,因为您实际上还没有构建包含该模块的 .so 。

您需要清除所有编译和链接错误,以便构建 proAudioRt.so。请注意,要真正包含 Lua 模块,它必须有一个名为 luaopen_proAudioRt() 的 C 可调用入口点,其签名为该

LUALIB_API int luaopen_proAudioRt(lua_State *L);

函数预计将构造模块的表,为其提供包含以下内容的成员:模块的功能。函数 luaL_register() 很方便这。

Lua 用户 wiki 有一个关于 绑定到 Lua 的部分,应该也会有帮助。

Lua is trying to tell you that it cannot find an implementation of the module "proAudioRt" which it tried to find in a variety of places. The first block of places are various attempts at loading an implementation in Lua, then there are a few tries at various shared object files that might have contained the module. Since none of the places work, require fails.

None worked, because you haven't actually built a .so containing the module.

You need to get all of the compile and link errors to clear up so that you build proAudioRt.so. Note that for that to actually contain a Lua module, it must have a C callable entry point named luaopen_proAudioRt(), with the signature

LUALIB_API int luaopen_proAudioRt(lua_State *L);

That function is expected to construct the module's table, supplying it with members containing the functions of the module. The function luaL_register() is handy for this.

The Lua users wiki has a section on binding to Lua that should be helpful as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文