I am learning how to use Pulse Audio. I try to compile with gcc $(pkg-config --cflags --libs libpulse) -lm asynch.c -o asynch
I get the following:
/usr/bin/ld: /tmp/ccWIAMyQ.o: in function `pa_state_cb':
asynch.c:(.text+0x24): undefined reference to `pa_context_get_state'
/usr/bin/ld: /tmp/ccWIAMyQ.o: in function `stream_request_cb':
asynch.c:(.text+0x98): undefined reference to `pa_stream_get_latency'
/usr/bin/ld: asynch.c:(.text+0x12f): undefined reference to `pa_stream_write'
/usr/bin/ld: /tmp/ccWIAMyQ.o: in function `stream_underflow_cb':
asynch.c:(.text+0x1e4): undefined reference to `pa_usec_to_bytes'
/usr/bin/ld: asynch.c:(.text+0x204): undefined reference to `pa_usec_to_bytes'
/usr/bin/ld: asynch.c:(.text+0x227): undefined reference to `pa_stream_set_buffer_attr'
/usr/bin/ld: /tmp/ccWIAMyQ.o: in function `main':
asynch.c:(.text+0x2d8): undefined reference to `sin'
/usr/bin/ld: asynch.c:(.text+0x320): undefined reference to `pa_mainloop_new'
/usr/bin/ld: asynch.c:(.text+0x330): undefined reference to `pa_mainloop_get_api'
/usr/bin/ld: asynch.c:(.text+0x34a): undefined reference to `pa_context_new'
/usr/bin/ld: asynch.c:(.text+0x369): undefined reference to `pa_context_connect'
/usr/bin/ld: asynch.c:(.text+0x383): undefined reference to `pa_context_set_state_callback'
/usr/bin/ld: asynch.c:(.text+0x39b): undefined reference to `pa_mainloop_iterate'
/usr/bin/ld: asynch.c:(.text+0x3f0): undefined reference to `pa_stream_new'
/usr/bin/ld: asynch.c:(.text+0x425): undefined reference to `pa_stream_set_write_callback'
/usr/bin/ld: asynch.c:(.text+0x440): undefined reference to `pa_stream_set_underflow_callback'
/usr/bin/ld: asynch.c:(.text+0x464): undefined reference to `pa_usec_to_bytes'
/usr/bin/ld: asynch.c:(.text+0x484): undefined reference to `pa_usec_to_bytes'
/usr/bin/ld: asynch.c:(.text+0x4ae): undefined reference to `pa_usec_to_bytes'
/usr/bin/ld: asynch.c:(.text+0x4dd): undefined reference to `pa_stream_connect_playback'
/usr/bin/ld: asynch.c:(.text+0x50f): undefined reference to `pa_stream_connect_playback'
/usr/bin/ld: asynch.c:(.text+0x541): undefined reference to `pa_mainloop_run'
/usr/bin/ld: asynch.c:(.text+0x54d): undefined reference to `pa_context_disconnect'
/usr/bin/ld: asynch.c:(.text+0x559): undefined reference to `pa_context_unref'
/usr/bin/ld: asynch.c:(.text+0x565): undefined reference to `pa_mainloop_free'
collect2: error: ld returned 1 exit status
I expected that I would get a program that plays a sine wave.