Hi
I've been looking at plib - a portable games library. I got it built and
installed OK but have come across a strange compile error. I have
distilled it down to this:
---start---
#include "ul.h"
//#include <plib/ul.h>
int main()
{
return 0;
}
----end----
If I include from a local copy of the header it works - but it fails if I use
the system include variant. It complains about a bunch of overloaded inline
functions:
/usr/include/plib/ul.h: In function 'void ulEndianSwap(short unsigned int*)':
/usr/include/plib/ul.h:342: error: declaration of C function 'void ulEndianSwap(short unsigned int*)' conflicts with
/usr/include/plib/ul.h:333: error: previous declaration 'void ulEndianSwap(unsigned int*)' here
and much more in a similar vein...
It looks like it's treating the header as a C header rather than C++ - why would
that be? Any ideas?
I've put a copy of ul.h up at <http://weatherley.net/src/ul.h>
James - 13 Oct 2005 14:49 GMT
I can answer my own question. After diffing the preprocessor output of a ""
include and a <> include I can see that OS X implicitly 'extern C's includes
in /usr/include. Moving the plib headers to /usr/local/include let me use <>
style includes successfully with the plib headers.