www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - using deimos.portaudio

reply "Samuele Carcagno" <sam.carcagno gmail.com> writes:
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 18 2012
next sibling parent reply 1100110 <10equals2 gmail.com> writes:
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 18 2012
parent reply "Samuele Carcagno" <sam.carcagno gmail.com> writes:
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 18 2012
parent "Samuele Carcagno" <sam.carcagno gmail.com> writes:
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 18 2012
prev sibling parent reply Johannes Pfau <nospam example.com> writes:
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 18 2012
parent "Samuele Carcagno" <sam.carcagno gmail.com> writes:
 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!
May 19 2012