Question

Recently I discovered there are C++ bindings for PortAudio, so to keep things nice and Object-Oriented I'm converting from the normal PortAudio C-functions to the C++ bindings. However, I ran into trouble with the callback function. I try to create a stream in the following way:

stream = new portaudio::MemFunCallbackStream<OutputChannel>(params, *this, &OutputChannel::output);

This call is made in a method of the OutputChannel-class. This same class contains the method which should function as a callback, hence the 'this' I'm passing to the MemFunCallbackStream-method. However when building, the linker gives an error:

Undefined symbols for architecture x86_64:
  "_Pa_OpenStream", referenced from:
      portaudio::MemFunCallbackStream<OutputChannel>::open(portaudio::StreamParameters const&)in outputchannel.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

I'm sure the PortAudio library is loaded, since some other (diagnostic) methods do work. What may be causing this error?

Was it helpful?

Solution

Argh, I feel stupid. Somehow, the library was no longer linked to my application, although it was before. So the error was due to a missing library after all. Problem solved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top