Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified
Accepted Solution

undefined reference to `snd_pcm_open_preferred'

I understand this error to mean this function can't be located in the headers or libraries. I am using this code from wave.c:

#include <sys/asoundlib.h>

....


	int card = -1;
	int dev = 0;
	snd_pcm_t *pcm_handle;
	int rtn;
	rtn = snd_pcm_open_preferred (&pcm_handle,&card, &dev, SND_PCM_OPEN_CAPTURE);

 

 

 The compiler is giving me:

 undefined reference to `snd_pcm_open_preferred'

 It has no problem with the reference to snd_pcm_t, so I know the header is being accessed.

 

I'm not sure what I'm doing wrong here. Any suggestions?

Thanks,
Scott

Developer
superdirt
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: undefined reference to `snd_pcm_open_preferred'

[ Edited ]

I'm also getting the same compile error for snd_pcm_open, in fact when I try and compile wave.c I get dozens of these errors.

 

 

BlackBerry Development Advisor
elena_laskavaia
Posts: 417
Registered: ‎10-27-2010
My Device: PlayBook

Re: undefined reference to `snd_pcm_open_preferred'

Means you did not link it against the library where the functions are