Hi, i'm learning with this amazing book but i'm front of a problem:
I try to compile this code on osx:
#include #include "portsf.h"
int main(int argc, const char * argv[]) {
PSF_PROPS props;
int sf;
sf = psf_sndOpen("lol.wav", &props, 0);
printf( "Sample rate = %d\n" , props. srate) ;
printf("number of channels = %d\n", props.chans);
if(sf < 0){
printf("Error: unable to open soundfile\n");
return 1;
}
return 0;
}
with this command: gcc main.c -o sf
and I obtain this error:
Undefined symbols for architecture x86_64:
"_psf_sndOpen", referenced from:
_main in main-480d90.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MBP-de-Octave-2:portsf_test octavelascoux$ gcc main.c -o sf
Undefined symbols for architecture x86_64:
"_psf_sndOpen", referenced from:
_main in main-290e5c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
MBP-de-Octave-2:portsf_test octavelascoux$ gcc main.c -o sf
Undefined symbols for architecture x86_64:
"_psf_sndOpen", referenced from:
_main in main-a0caba.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any Ideas ?
Thanks