如何用mingw在windows上编译rtaudio?

时间:2016-10-22 14:38:56

标签: c++ mingw rtaudio

我想在我的项目中使用rtaudio。我按照install.txt中的说明操作,告诉我运行./configure然后make。

当我跑步时,我收到一堆警告:

$ make
Making all in .
make[1]: Entering directory `/c/Users/Onur/Desktop/Development/rtaudio-4.1.2'
  CXX      RtAudio.lo
In file included from RtAudio.cpp:43:0:
RtAudio.h:585:11: error: 'uintptr_t' does not name a type
   typedef uintptr_t ThreadHandle;
           ^
In file included from RtAudio.cpp:43:0:
RtAudio.h:608:3: error: 'ThreadHandle' does not name a type
   ThreadHandle thread;
   ^
In file included from RtAudio.cpp:3682:0:
c:\mingw\include\audioclient.h:166:50: error: expected constructor, destructor, or type conversion before ';' token
 DEFINE_ENUM_FLAG_OPERATORS(AUDCLNT_STREAMOPTIONS);
                                                  ^
c:\mingw\include\audioclient.h:206:13: error: '_In_' has not been declared
             _In_  AUDCLNT_SHAREMODE ShareMode,
             ^
c:\mingw\include\audioclient.h:206:37: error: expected ',' or '...' before 'ShareMode'
             _In_  AUDCLNT_SHAREMODE ShareMode,
                                     ^

如果有人可以指导我,那会很棒。

1 个答案:

答案 0 :(得分:2)

我在Windows上找到了使用cmake的解决方案:

  1. 只需下载cmake gui
  2. 从github或其官方网页获取rtaudio来源
  3. 打开RtAudio.h并包含math.h
  4. 使用cmake gui生成构建文件到一个单独的文件夹(在配置之前切换BUILD_TESTING)
  5. 使用终端导航到构建文件夹。并运行mingw32-make。确保将mingw / bin添加到路径中,以便找到mingw32-make。
  6. 你应该有三个文件:librtaudio.dll librtaudio.dll.a和 librtaudio_static.a
  7. 这对我有用。