The error messages indicate that you did not link with the libcdio library.

If the command
   pkg-config libcdio --libs

works and returns something, then add that string on to the ld command
(which is usually done under the covers say from gcc). Here's an example:

$ pkg-config libcdio --libs
> -L/usr/local/lib -lcdio -lm
> $ cd llibcdio/example/
> $ ls
> audio.c ...
> $ gcc audio.c `pkg-config libcdio --libs` -o audio
> $
>

If pkg-config isn't around, then locate where libcdio.a library archive
exists on your computer. And give that as file in the linking. Here's an
example of that, again using gcc as an example

 $ locate libcdio.a
> /usr/local/lib/libcdio.a
> ..
> $ gcc audio.c  /usr/local/lib/libcdio.a -o audio
> $
>

In the example above  -L /usr/local/lib and -lcdio would also work.

On Mon, Aug 9, 2010 at 5:22 PM, Trevor Vallender <[email protected]> wrote:

> Sorry this is a bit of a basic question I think, but I'm using libcdio
> in my first real C app.
>
> I am trying to compile the second example from the documentation, have
> used #include <cdio/cdio.h>, but when I compile I receive:
>
> /tmp/ccGMMKAB.o: In function `main':
> cdio.c:(.text+0x19): undefined reference to `cdio_open'
> cdio.c:(.text+0x30): undefined reference to `cdio_get_driver_name'
> cdio.c:(.text+0x4d): undefined reference to `cdio_get_default_device'
> cdio.c:(.text+0x6a): undefined reference to `cdio_destroy'
> cdio.c:(.text+0x8e): undefined reference to `cdio_have_driver'
> cdio.c:(.text+0x9e): undefined reference to `cdio_driver_describe'
> cdio.c:(.text+0xbd): undefined reference to `cdio_driver_describe'
> collect2: ld returned 1 exit status
>
> What am I doing wrong? Is there some extra option I must pass to gcc?
>
> Regards,
> Trevor Vallender
>
>
>
> _______________________________________________
> Libcdio-help mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/libcdio-help
>
_______________________________________________
Libcdio-help mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/libcdio-help

Reply via email to