How to compile rtaudio on windows with mingw?

1.4k Views Asked by At

I want to use rtaudio in my project. I am following instructions in install.txt which tells me to run ./configure then make.

When I run make I get bunch of warnings:

$ 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,
                                     ^

Would be awesome if someone could guide me on this.

1

There are 1 best solutions below

0
On BEST ANSWER

I found a solution using cmake on windows:

  1. Simply download cmake gui
  2. Get the rtaudio source from github or their official webpage
  3. Open RtAudio.h and include math.h
  4. Generate build files with cmake gui to a seperate folder (toggle BUILD_TESTING off before configuring)
  5. Navigate to build folder using a terminal. And run mingw32-make. Make sure mingw/bin is added to path so it ca find mingw32-make.
  6. You should have three files: librtaudio.dll librtaudio.dll.a and librtaudio_static.a

This worked for me.