Marius Gedminas wrote:

> On Thu, Jun 06, 2019 at 11:59:34AM +0200, Bram Moolenaar wrote:
> > It appears libcanberra is widely available.  My system also has the -dev
> > package installed (I didn't do that, perhaps because of a gtk
> > dependency).  I could not find something for autoconf though.  But I
> > expect it to be simple.
> 
> On my system libcanberra-dev ships a pkg-config file, so it should be
> simple to hook it up to autoconf.
> 
>   $ pkg-config --libs libcanberra
>   -lcanberra
> 
>   $ pkg-config --cflags libcanberra
>   -D_REENTRANT
> 
> (I've never used autoconf so I'm afraid I cannot offer a patch.)

I tried a little example:


        #include <unistd.h>
        #include <canberra.h>
        int main () {
                ca_context * hello;
                ca_context_create (&hello);
                ca_context_play (hello, 0,
                        CA_PROP_EVENT_ID, "phone-incoming-call",
                        CA_PROP_EVENT_DESCRIPTION, "hello world",
                        NULL);
                sleep(2);
                return 0;
        }

gcc -o sound -D_REENTRANT -lcanberra sound.c
/usr/bin/ld: /tmp/ccArSjRM.o: in function `main':
sound.c:(.text+0x1f): undefined reference to `ca_context_create'
/usr/bin/ld: sound.c:(.text+0x57): undefined reference to `ca_context_play'
collect2: error: ld returned 1 exit status

Somehow linking doesn't work, must be missing something...


-- 
Common sense is what tells you that the world is flat.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201906061207.x56C7kG6023479%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui