При компиляции вылетает указанная ниже ошибка. В чем может быть проблем? Linux
Часть кода
в шапке
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <fcntl.h>
#include <netinet/tcp.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <pulse/simple.h>
#include <pulse/error.h>
static const pa_sample_spec ss = {
.format = PA_SAMPLE_ULAW,
.rate = 8000,
.channels = 1
};
pa_simple *s_in, *s_out = NULL;
int ret = 1;
int error;
/* Create a new playback stream */
if (!(s_out = pa_simple_new(NULL, argv[0], PA_STREAM_PLAYBACK, NULL, "playback", &ss, NULL, NULL, &error))) {
fprintf(stderr, __FILE__": pa_simple_new() failed: %s\n", strerror(errno));
goto finish;
}
if (!(s_in = pa_simple_new(NULL, argv[0], PA_STREAM_RECORD, NULL, "record", &ss, NULL, NULL, &error))) {
fprintf(stderr, __FILE__": pa_simple_new() failed: %s\n", strerror(errno));
goto finish;
}
for (;;) {
uint8_t buf[BUFSIZE];
ssize_t r;
if (pa_simple_read(s_in, buf, sizeof(buf), &error) < 0) {
fprintf(stderr, __FILE__": read() failed: %s\n", strerror(errno));
goto finish;
}
if(write(fd, buf, BUFSIZE) != BUFSIZE)
printf("\nErr\n");
if(write(fd, audio, 7) != 7)
printf("\nErr\n");*/
if (pa_simple_write(s_out, buf, sizeof(buf), &error) < 0) {
fprintf(stderr, __FILE__": pa_simple_write() failed: %s\n", strerror(errno));
goto finish;
}
}
/* Make sure that every single sample was played */
if (pa_simple_drain(s_out, &error) < 0) {
fprintf(stderr, __FILE__": pa_simple_drain() failed: %s\n", strerror(errno));
goto finish;
}
ret = 0;
finish:
if(fd){
shutdown(fd, SHUT_RDWR);
close(fd);
}
if (s_in)
pa_simple_free(s_in);
if (s_out)
pa_simple_free(s_out);
return ret;
}
Ошибка
cgiplay_AudioOut_HTTP.cpp:(.text+0x22b): undefined reference to `pa_simple_new'
cgiplay_AudioOut_HTTP.cpp:(.text+0x2b5): undefined reference to `pa_simple_new'
cgiplay_AudioOut_HTTP.cpp:(.text+0x325): undefined reference to `pa_simple_read'
cgiplay_AudioOut_HTTP.cpp:(.text+0x3ea): undefined reference to `pa_simple_write'
cgiplay_AudioOut_HTTP.cpp:(.text+0x463): undefined reference to `pa_simple_free'
cgiplay_AudioOut_HTTP.cpp:(.text+0x47c): undefined reference to `pa_simple_free'
collect2: error: ld returned 1 exit status