Thread overview
using deimos.portaudio
May 19, 2012
Samuele Carcagno
May 19, 2012
1100110
May 19, 2012
Samuele Carcagno
May 19, 2012
Samuele Carcagno
May 19, 2012
Johannes Pfau
May 19, 2012
Samuele Carcagno
May 19, 2012
Hi,

I'm try to use the deimos portaudio bindings

https://github.com/D-Programming-Deimos/portaudio

I've managed to compile and run the test demo provided with the module.
It seems to work fine. However, when I add this statement:

PaStreamParameters outputParameters;

that I need to specify the output parameters for using the
Pa_OpenStream function, rather than the Pa_OpenDefaultStream
function used in the example, I get the following linker error:

dmd pa_test2.d -L-lportaudio
pa_test2.o: In function `_Dmain':
pa_test2.d:(.text._Dmain+0x22): undefined reference to `_D6deimos9portaudio18PaStreamParameters6__initZ'
collect2: ld returned 1 exit status
--- errorlevel 1

I'm a newby on D programming and also C programming,
so I'm pretty much lost even after extensive googling.

I'm on Debian Squeeze 64-bit, using the dmd2 compiler.
Any help would be appreciated!
May 19, 2012
On Fri, 18 May 2012 21:31:57 -0500, Samuele Carcagno <sam.carcagno@gmail.com> wrote:

> Pa_OpenStream

Does the result of calling Pa_GetVersionText() closely match the version of the library installed on your computer?

I use Debian as well, and it's not exactly known for speedy updates...
If your version is too old you'll probably have to backport the changes or compile a newer version.

(both are relatively easy.)

Did you call the initialization before trying this?


-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/
May 19, 2012
On Saturday, 19 May 2012 at 02:54:22 UTC, 1100110 wrote:
> On Fri, 18 May 2012 21:31:57 -0500, Samuele Carcagno <sam.carcagno@gmail.com> wrote:
>
>> Pa_OpenStream
>
> Does the result of calling Pa_GetVersionText() closely match the version of the library installed on your computer?
>
> I use Debian as well, and it's not exactly known for speedy updates...
> If your version is too old you'll probably have to backport the changes or compile a newer version.
>
> (both are relatively easy.)
>
> Did you call the initialization before trying this?

Pa_GetVersionText() gives me:
PortAudio V19-devel (built Nov 25 2010)

the version of the deb for portaudio19-dev is 19+svn20071022-3

so I guess I should try compiling a newer version of portaudio
to use it with d.

I also have a wheezy install and an Ubuntu Precise install, that
probably have newer portaudio versions. Unfortunately when I try
to install portaudio-v19 on those boxes though, synaptic wants to
remove
audacity, ardour and jackd stuff, but I will let it do that
just to see if I can get the d program to compile with the
portaudio
version available there.

Thanks for the help!


May 19, 2012
I get the same error on debian wheezy where the portaudio version is:
PortAudio V19-devel (built Dec  7 2011 23:15:44)

dmd pa_test2.d -L-lportaudio
pa_test2.o: In function `_Dmain':
pa_test2.d:(.text._Dmain+0x22): undefined reference to `_D6deimos9portaudio18PaStreamParameters6__initZ'
collect2: ld returned 1 exit status
--- errorlevel 1



May 19, 2012
Am Sat, 19 May 2012 04:31:57 +0200
schrieb "Samuele Carcagno" <sam.carcagno@gmail.com>:

> Hi,
> 
> I'm try to use the deimos portaudio bindings
> 
> https://github.com/D-Programming-Deimos/portaudio
> 
> I've managed to compile and run the test demo provided with the
> module.
> It seems to work fine. However, when I add this statement:
> 
> PaStreamParameters outputParameters;
> 
> that I need to specify the output parameters for using the Pa_OpenStream function, rather than the Pa_OpenDefaultStream function used in the example, I get the following linker error:
> 
> dmd pa_test2.d -L-lportaudio
> pa_test2.o: In function `_Dmain':
> pa_test2.d:(.text._Dmain+0x22): undefined reference to
> `_D6deimos9portaudio18PaStreamParameters6__initZ'
> collect2: ld returned 1 exit status
> --- errorlevel 1
> 

The missing symbol is a D symbol. You probably have to compile in
'deimos/portaudio.di', so in your 'dmd yourprogram.d' compile command
add the full path to the di file:
'dmd yourprogram.d ../path/to/deimos/portaudio.di'

May 19, 2012
> The missing symbol is a D symbol. You probably have to compile in
> 'deimos/portaudio.di', so in your 'dmd yourprogram.d' compile command
> add the full path to the di file:
> 'dmd yourprogram.d ../path/to/deimos/portaudio.di'

Thanks, that was in fact the problem!