[Flac-dev] 1.2.1 pkg-config file "error"

Paul Davis paul at linuxaudiosystems.com
Wed Sep 17 07:17:56 PDT 2008


hi, and sorry that my first post to the list is a complaint.

the .pc file for 1.2.1 produces this for --cflags:

    -I$PREFIX/include/FLAC

i humbly suggest that this is wrong. it appears to support inclusion of
FLAC headers with

    #include <filename.h>

rather than

    #include <FLAC/filename.h>

but more importantly, it means that when building an app using
pkg-config to determine compiler flags, we end up with a rather serious
problem as soon as the app uses "assert.h":

   #include <assert.h>

 combined with:

   -I/usr/local/include/FLAC

means that we find the FLAC assert.h file first. this file the tries to
help out by doing

  #include <assert.h>

which simply causes it to include itself again.

The .pc.in file should use $PREFIX/include for the cflags, not
$includedir which is where the headers are installed. apps should use
<FLAC/foobar.h> to include FLAC headers, not <foobar.h> as this mistake
with assert.h demonstrates.

--p




More information about the Flac-dev mailing list