[Stk] Installing RtAudio and STK in Windows

Uğur Güney ugurguney at gmail.com
Mon Jan 26 17:04:29 PST 2009


# Hi Gary,
# Thank you very much! Now I succeed to compile RtAudio under Windows
using Cygwin.
# The option to use MingW version of gcc compiler instead of cygwin
one is -mno-cygwin. So here is an example Makefile which was in
RtAudio/tests folder to create the audioprobe binary:

CC=gcc -mno-cygwin
INCLUDES=-I".." -I"../include"
SRC_DIR=".."
CFLAGS=-D__WINDOWS_DS__ $(INCLUDES) -O3 -c
LIBS=-lole32 -lwinmm -lWsock32 -ldsound -lstdc++ -lm
OBJS=audioprobe.o RtAudio.o

audioprobe: $(OBJS)
	$(CC) -o audioprobe.exe $(OBJS) $(LIBS)
audioprobe.o: audioprobe.cpp
	$(CC) $(CFLAGS) audioprobe.cpp
RtAudio.o:
	$(CC) $(CFLAGS) $(SRC_DIR)/$*.cpp

clean:
	rm -f audioprobe.exe *~ *.o

# I tested audioprobe and playsaw examples and they found my sound
device correctly, sound as expected.
# I'll post this to the list so that maybe future generations find it
useful. I will try to compile some Stk examples now.
# Have a nice day!
-ugur guney-

On Mon, Jan 26, 2009 at 6:02 PM, Gary Scavone <gary at ccrma.stanford.edu> wrote:
> Hi Ugur,
>
> You probably need to add "-lole32 -lwinmm -lWsock32 -ldsound" to your
> compile statement.
>
> Regards,
>
> --gary
>
> On 24-Jan-09, at 4:37 PM, Uğur Güney wrote:
>
>> # Hi Gary,
>> # Thanks for your  answer.
>>
>> On Sat, Jan 24, 2009 at 5:07 PM, Gary Scavone <gary at ccrma.stanford.edu>
>> wrote:
>>>
>>> Hi Ugur,
>>>
>>> The problem is that the Windows support in the configure script is
>>> limited
>>> to "mingw32" systems.  If you can figure out what the host type is for
>>> Cygwin, then it can be added to the configure script.
>>
>> # What is the "host type"? Or can you give me directions for learning
>> about this stuff? I am an intermediate (actually
>> beginner-intermediate) programmer and I am bad at compiling things
>> under Windows. But if I could be able help I'll be glad.
>>
>>> If you want to compile without the configure script, you will need either
>>> __WINDOWS_DS__ and/or __WINDOWS_ASIO__ preprocessor definitions.  The
>>> __WINDOWS_MM__ definition is for RtMidi.
>>
>> # Ok. I changed the makefile according to your info. and run it in
>> rtaudio-4.04/tests folder
>>
>> CC=/cygdrive/c/Program\ Files/CodeBlocks/MinGW/bin/gcc
>> INCLUDES=-I".." -I"../include"
>> SRC_DIR=".."
>> FLAGS=-D__WINDOWS_DS__ $(INCLUDES) -O3 -c
>> LIBS=-lstdc++ -lm
>> OBJS=audioprobe.o RtAudio.o
>>
>> audioprobe: $(OBJS)
>>        $(CC) -o audioprobe.exe $(OBJS) $(LIBS)
>> audioprobe.o: audioprobe.cpp
>>        $(CC) $(FLAGS) audioprobe.cpp
>> RtAudio.o:
>>        $(CC) $(FLAGS) $(SRC_DIR)/$*.cpp
>> clean:
>>        rm -f audioprobe.exe *~ *.o
>>
>> # This time compilations of RtAudio.o and audioprobe.o are done. But
>> at the linking stage gcc complaint about "undefined references to"
>> Directsound somethings. I think this is because I do not have the
>> directsound library in the LIBS variable. How can I get a directsound
>> library? Do you know its name? Maybe I can search it with Google.
>> -ugur-
>>
>>> Regards,
>>>
>>> --gary
>>>
>>> On 24-Jan-09, at 5:38 AM, Uğur Güney wrote:
>>>
>>>> # Hi,
>>>> # I want to make a cross-platform realtime sound application (a pitch
>>>> tracker) and thought that RtAudio is a good choice of a sound API for
>>>> this purpose.
>>>> # In Ubuntu I just adjusted the RT_BUFFER_SIZE in Stk.h and followed
>>>> the ./configure & make steps and have a working system. (I think
>>>> especially percussive sounds are great!)
>>>> # But under Windows (Vista) I can not pass the configure step. I'm
>>>> using Cygwin. Gave this command:
>>>>
>>>> $ ./configure --with-ds
>>>>
>>>> # Configure script stoped at this step:
>>>>
>>>> checking for audio API... configure: error: Unknown system type for
>>>> realtime support!
>>>>
>>>> # I searched through the mail archive and found a makefile suggestion.
>>>> I adjusted it like this:
>>>>
>>>> CC=gcc
>>>> INCLUDES=-I".."
>>>> SRC_DIR=".."
>>>> FLAGS=-D__WINDOWS_MM__ $(INCLUDES) -O3 -c
>>>> LIBS=-lwinmm -lstdc++ -lm
>>>> OBJS=audioprobe.o RtAudio.o
>>>>
>>>> audioprobe: $(OBJS)
>>>>      $(CC) -o audioprobe.exe $(OBJS) $(LIBS)
>>>> audioprobe.o: audioprobe.cpp
>>>>      $(CC) $(FLAGS) audioprobe.cpp
>>>> RtAudio.o:
>>>>      $(CC) $(FLAGS) $(SRC_DIR)/$*.cpp
>>>> clean:
>>>>      rm -f audioprobe.exe *~ *.o
>>>>
>>>>
>>>> # This makefile compiled without any errors. But audioprobe.exe gave
>>>> this output:
>>>>
>>>> Compiled APIs:
>>>> RtAudio Dummy
>>>>
>>>> RtApiDummy: This class provides no functionality.
>>>>
>>>>
>>>> Current API: RtAudio Dummy
>>>>
>>>> Found 0 device(s) ...
>>>>
>>>> # What do you suggest me to do?
>>>> -ugur guney-
>>>>
>>>> _______________________________________________
>>>> Stk mailing list
>>>> Stk at ccrma.stanford.edu
>>>> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>>>
>>>
>
>



More information about the Stk mailing list