glew.pc publishes -I${prefix}/include/GL, the specific directory where the *.h are installed. That means my source would have:
#include <glew.h>
or
#include <glxew.h>
But GL/glxew.h has in it:
#include <GL/glew.h>
which means it needs the -I flag for ${prefix}/include (without the GL subdir compontent). If I install glew in a place that is not in my compiler's search paths, #include <glxew.h> is a compile-time error because GL/glew.h cannot be located.
Three possible solutions:
Change glxew.h to include <glew.h> so that everything is consistently relative to the -I the .pc publishes. That contradicts many of the example code fragments in doc/*.html
Change the .pc to also publish the higher-level -I flag so that either #include <GL gl*.h=""> or <gl*.h> will work.
Change the .pc to only publish the higher-level -I flag so that everyone would always and only use #include <gl*.h>. That probably breaks third-party code that might have read the .pc and followed what -I said.
Sorry for the mess, still getting used to the new SF tracker formatting. Those three bold items should read respectively:
At first glance, I think the .pc file is simply wrong.
It should be
in source code, as far as I recall.
(I'll go check...)
Last edit: Nigel Stewart 2014-12-15
Diff:
Fixed in git, thanks.