Hello,
I need to interact with my sound card using an ANSI C program such that I can capture the sound cards output and then manipulate the capture and send it back to the sound cards input for playback. I have been trying to get the portaudio(www.portaudio.com) libraries to compile so it could serve as my API to the sound card. Is this the best code library for this purpose or would you recommend using something else?
So now the specifics of the current issue I am seeing with using portaudio. I was able to successfully able to install v18 of portaudio using MinGW/MSYS on my windows XP machine. Unfortunately that did not solve the undefined reference error I show below, when trying to work through the portaudio tutorial. I have done some searching in an effort to resolve this but to no avail. I have tried to make sure the .c file I wanted to compile(see below error message) was in the same directory as my portaudio.h file(and I've tried this with both the .c and .h under pa_common, MinGW, and /usr/local/include). I always get the same error though. I have also tried use -L 'path to portaudio.' and -lportaudio but I always get a "cannot find -lportaudio" when using -lportaudio. Is there something obvious I'm missing? I wouldn't be suprised since its been years since I worked in Unix and C. Any feedback is greatly appreciated.
Thanks,
Brian
/usr/local/include
$ gcc basictest.c -o basictest
C:/DOCUME~1/BRIAN~1/LOCALS~1/Temp/cc1GI8mn.o:basictest.c.text+0x2b): undefined reference to `Pa_Initialize'
C:/DOCUME~1/BRIAN~1/LOCALS~1/Temp/cc1GI8mn.o:basictest.c.text+0x33): undefined reference to `Pa_Terminate'
C:/DOCUME~1/BRIAN~1/LOCALS~1/Temp/cc1GI8mn.o:basictest.c.text+0x75): undefined reference to `Pa_GetErrorText'
collect2: ld returned 1 exit status
basictest.c
Code:
#include <stdio.h>
#include "portaudio.h"
main () {
PaError err;
err = Pa_Initialize();
if( err != paNoError) goto error;
error:
Pa_Terminate();
fprintf( stderr, "An error occured while using the portaudio stream\n" );
fprintf( stderr, "Error number: %d\n", err );
fprintf( stderr, "Error message: %s\n", Pa_GetErrorText( err ) );
return err;
}