我知道为什么我无法使用或无法在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]: ?
答案 0 :(得分:1)
Lua试图告诉你它无法找到它试图在各种地方找到的模块"proAudioRt"
的实现。第一个地方块是在Lua中加载实现的各种尝试,然后对可能包含该模块的各种共享对象文件进行了一些尝试。由于没有一个地方有效,require
失败了。
没有用,因为你实际上没有构建包含模块的.so。
您需要清除所有编译和链接错误,以便构建proAudioRt.so
。请注意,为了实际包含Lua模块,它必须具有名为luaopen_proAudioRt()
的C可调用入口点,并带有签名
LUALIB_API int luaopen_proAudioRt(lua_State *L);
该函数应该构造模块的表,为其提供包含模块功能的成员。函数luaL_register()
对此非常方便。
Lua用户wiki有binding to Lua部分也应该有用。