问题描述
我要使用在Cygwin上编译的webrtc的VAD模块.Cygwin为此提供了一些软件包:软件包
I want to use the VAD module of webrtc, compiling on Cygwin.Cygwin has some packages for this: packages
我安装了选定的软件包,并想弄清楚如何进行编译.我已经在下面列出了我已经尝试过的内容.我是否对此采取了正确的方法?还是应该以其他方式继续?我是C语言方面的业余爱好者.
I installed the selected packages and want to work out how to get things compiling. I've included what I've tried so far below. Am I taking the right approach to this? Or should I continue in a different way? I'm an amateur when it comes to c code.
main.cpp
int main() {
AudioProcessing* apm;
}
编译
$ g++ main.cpp
main.cpp: In function ‘int main()’:
main.cpp:3:2: error: ‘AudioProcessing’ was not declared in this scope
AudioProcessing* apm;
^
main.cpp:3:19: error: ‘apm’ was not declared in this scope
AudioProcessing* apm;
因此,我需要包含一些标头并链接dll以提供我猜测的实现.
So I need to include some headers and link a dll to provide the implementation I'm guessing.
$ ls /usr/include/webrtc_audio_processing/webrtc/
base/ common_types.h system_wrappers/
common.h modules/ typedefs.h
$ find / -name "*rtc*dll"
/bin/cygsmartcols-1.dll
/bin/cygwebrtc_audio_processing-1.dll
/usr/bin/cygsmartcols-1.dll
/usr/bin/cygwebrtc_audio_processing-1.dll
我在audio_processing.h中找到了包含AudioProcessing类的标头
I found the header containing class AudioProcessing in audio_processing.h
main.cpp
#include "audio_processing.h"
int main() {
AudioProcessing* apm;
}
编译
$ g++ main.cpp -o main -L/bin/ -lcygwebrtc_audio_processing-1 -I/usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/
In file included from main.cpp:1:0:
/usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h:22:35: fatal error: webrtc/base/arraysize.h: No such file or directory
compilation terminated.
抱歉,这似乎很明显,我们都必须从某个地方开始.
Sorry if this seems obvious, we all have to start somewhere.
讨论结果:
以下内容导致在Cygwin上使用libwertc-audio-processing-devel成功编译了一个琐碎的程序.
The following resulted in a successful compilation of a trivial program using libwertc-audio-processing-devel on Cygwin.
$ cat main.cpp
#include "webrtc/modules/audio_processing/include/audio_processing.h"
int main() {
webrtc::AudioProcessing* apm;
}
$ g++ main.cpp -o main -I/usr/include/webrtc_audio_processing/ -DWEBRTC_WIN -std=gnu++11 -L/bin/ -lcygwebrtc_audio_processing-1
推荐答案
查看包装内容:
2016-07-28 08:48 0 usr/include/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/base/
2016-07-28 08:48 1190 usr/include/webrtc_audio_processing/webrtc/base/arraysize.h
2016-07-28 08:48 2257 usr/include/webrtc_audio_processing/webrtc/base/basictypes.h
2016-07-28 08:48 10507 usr/include/webrtc_audio_processing/webrtc/base/checks.h
2016-07-28 08:48 1407 usr/include/webrtc_audio_processing/webrtc/base/constructormagic.h
2016-07-28 08:48 3572 usr/include/webrtc_audio_processing/webrtc/base/maybe.h
2016-07-28 08:48 1248 usr/include/webrtc_audio_processing/webrtc/base/platform_file.h
2016-07-28 08:48 3343 usr/include/webrtc_audio_processing/webrtc/common.h
2016-07-28 08:48 27807 usr/include/webrtc_audio_processing/webrtc/common_types.h
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/modules/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/beamformer/
2016-07-28 08:48 3534 usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/beamformer/array_util.h
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/
2016-07-28 08:48 38576 usr/include/webrtc_audio_processing/webrtc/modules/audio_processing/include/audio_processing.h
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/modules/interface/
2016-07-28 08:48 27021 usr/include/webrtc_audio_processing/webrtc/modules/interface/module_common_types.h
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/system_wrappers/
2016-07-28 08:48 0 usr/include/webrtc_audio_processing/webrtc/system_wrappers/include/
2016-07-28 08:48 3706 usr/include/webrtc_audio_processing/webrtc/system_wrappers/include/trace.h
2016-07-28 08:48 3682 usr/include/webrtc_audio_processing/webrtc/typedefs.h
2016-07-28 08:48 0 usr/lib/
2016-07-28 08:48 1360018 usr/lib/libwebrtc_audio_processing.dll.a
2016-07-28 08:48 0 usr/lib/pkgconfig/
2016-07-28 08:48 317 usr/lib/pkgconfig/webrtc-audio-processing.pc
可能只有include指令
the include directive is likely only
-I/usr/include/webrtc_audio_processing
这篇关于使用libwebrtc-audio-processing-devel的Cygwin编译程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!