KhronosGroup / OpenCOLLADA

652 stars 251 forks source link

error: conflicting declaration 'typedef struct real_pcre8_or_16 pcre' #570

Open hobbes1069 opened 6 years ago

hobbes1069 commented 6 years ago

I'm currently getting this error with 1.6.62 on both Fedora 28 and Rawhide. Could be GCC 8 being more picky?

BUILDSTDERR: In file included from /builddir/build/BUILD/OpenCOLLADA-1.6.62/COLLADABaseUtils/src/COLLADABUURI.cpp:18:
BUILDSTDERR: /usr/include/pcre.h:325:33: error: conflicting declaration 'typedef struct real_pcre8_or_16 pcre'
BUILDSTDERR:  typedef struct real_pcre8_or_16 pcre;
BUILDSTDERR:                                  ^~~~
BUILDSTDERR: In file included from /builddir/build/BUILD/OpenCOLLADA-1.6.62/COLLADABaseUtils/src/COLLADABUURI.cpp:14:
BUILDSTDERR: /builddir/build/BUILD/OpenCOLLADA-1.6.62/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h:17:26: note: previous declaration as 'typedef struct real_pcre pcre'
BUILDSTDERR:  typedef struct real_pcre pcre;
BUILDSTDERR:                           ^~~~
hobbes1069 commented 6 years ago

Looks like in pcre-8.42-rc1 the definition changed... Not sure if the redefinition is required but removing it and including the system pcre.h fix the build for me.

--- a/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
+++ b/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
@@ -12,9 +12,7 @@
 #define __COLLADABU_PCRECOMPILEDPATTERN_H__

 #include "COLLADABUPrerequisites.h"
-
-struct real_pcre;
-typedef struct real_pcre pcre;
+#include "pcre.h"

 namespace COLLADABU
devurandom commented 5 years ago

Duplicate of issue #547

devurandom commented 5 years ago

Could you please hand in your patch as a pull request?