CC fcobjs.lo In file included from ../../fontconfig-2.12.3/src/fcobjs.c:33:0: fcobjshash.gperf:28:1: error: conflicting types for 'FcObjectTypeHash' ../../fontconfig-2.12.3/src/fcobjs.c:28:1: note: previous declaration of 'FcObjectTypeHash' was here FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len); ^~~~~~~~~~~~~~~~ In file included from ../../fontconfig-2.12.3/src/fcobjs.c:33:0: fcobjshash.gperf:172:1: error: conflicting types for 'FcObjectTypeLookup' ../../fontconfig-2.12.3/src/fcobjs.c:31:1: note: previous declaration of 'FcObjectTypeLookup' was here FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len); ^~~~~~~~~~~~~~~~~~ Building on 64bit mingw (msys2) 2.12.1 Builds fine gperf version is 3.1 FC_GPERF_SIZE_T in config.h is size_t
That is because you have newer version of gperf installed. remove src/fcobjs.hash.h and try again.
(In reply to Akira TAGOH from comment #1) > That is because you have newer version of gperf installed. remove > src/fcobjs.hash.h and try again. meant src/fcobjshash.h
Fixed in git to regenerate fcobjshash.h on updating Makefile. so should be updated after configure then.
2.12.3 with the patch from git gives me this now: $ make V=1 ... ... make[3]: Entering directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32/fc-glyphname' make[3]: Nothing to be done for 'all-am'. make[3]: Leaving directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32/fc-glyphname' make[2]: Leaving directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32/fc-glyphname' Making all in src make[2]: Entering directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32/src' /bin/sh /home/xy/M/mingw-w64-fontconfig/src/fontconfig-2.12.3/missing gperf -m 100 fcobjshash.gperf > fcobjshash.h.tmp && \ mv -f fcobjshash.h.tmp fcobjshash.h || ( rm -f fcobjshash.h.tmp && false ) Cannot open input file 'fcobjshash.gperf' make[2]: *** [Makefile:906: fcobjshash.h] Error 1 make[2]: Leaving directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32/src' make[1]: *** [Makefile:581: all-recursive] Error 1 make[1]: Leaving directory '/home/xy/M/mingw-w64-fontconfig/src/build-x86_64-w64-mingw32' make: *** [Makefile:465: all] Error 2
Hmm, where is fcobjshash.gperf then?
Not 100% sure, but fcobjshash.gperf exists in the srcdir but not in the builddir where the command is executed.
Hm, then removing fcobjshash.gperf should be the workaround.
should be fixed in https://cgit.freedesktop.org/fontconfig/commit/?id=28139816d62b8444ca61a000a87c71e59fef104d Please test.
Now I get In file included from ../../fontconfig-2.12.3/src/fcobjs.c:33:0: fcobjshash.gperf:28:1: error: conflicting types for 'FcObjectTypeHash' "aspect",FC_ASPECT_OBJECT ^~~~~~~~~~~~~~~~ ../../fontconfig-2.12.3/src/fcobjs.c:28:1: note: previous declaration of 'FcObjectTypeHash' was here FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len); ^~~~~~~~~~~~~~~~ In file included from ../../fontconfig-2.12.3/src/fcobjs.c:33:0: fcobjshash.gperf:172:1: error: conflicting types for 'FcObjectTypeLookup' ../../fontconfig-2.12.3/src/fcobjs.c:31:1: note: previous declaration of 'FcObjectTypeLookup' was here FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len); ^~~~~~~~~~~~~~~~~~
Can you give me more detailed logs? after those changes, fcobjshash.gperf and fcobjshash.h should be regenerated and that error should be gone though.
Removing both src/fcobjshash.h and src/fcobjshash.gperf and re-running configure solves the issue. Thanks !
just made a testing tarball from current git and tried to build without any trick. I can see no problem. so closing.
*** Bug 101514 has been marked as a duplicate of this bug. ***
*** Bug 101546 has been marked as a duplicate of this bug. ***
I'm reopening as I can reproduce 100% with 2.12.4: * building out-of-tree * using a tarball release * gperf 3.1 The reason seems clear to me: * src/fcobjshash.h is still shipped in the tarball * It's referred to with "#include "fcobjshash.h" This leads to compiler always looking into the source directory first, and always finding the shipped header and using that. The new generated version is never even considered. Is there a reason to ship the header if it's nowadays also always generated?
No, not at all I suppose. fixed in git. thank you for pointing that out.
Which commit fixes this?
The version 2.12.6 of Fontconfig still has this problem of conflicting types of parameters of the functions FcObjectTypeHash() and FcObjectTypeLookup(), if compiled in a directory other than the directory "fontconfig-2.12.6". I obtained the source from https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.6.tar.gz ### I did the following mkdir fontconfig-2.12.6-build cd fontconfig-2.12.6-build ../fontconfig-2.12.6/configure make ### Actual Result The "make" was terminated with the following error messages. In file included from fontconfig-2.12.6/src/fcobjs.c:33: fcobjshash.gperf:28:1: error: conflicting types for 'FcObjectTypeHash' FcObjectTypeHash (register const char *str, register size_t len) ^ fontconfig-2.12.6/src/fcobjs.c:28:1: note: previous declaration is here FcObjectTypeHash (register const char *str, register FC_GPERF_SIZE_T len); ^ In file included from fontconfig-2.12.6/src/fcobjs.c:33: fcobjshash.gperf:166:1: error: conflicting types for 'FcObjectTypeLookup' FcObjectTypeLookup (register const char *str, register size_t len) ^ fontconfig-2.12.6/src/fcobjs.c:31:1: note: previous declaration is here FcObjectTypeLookup (register const char *str, register FC_GPERF_SIZE_T len); ^ 2 errors generated. make[3]: *** [fcobjs.lo] Error 1 make[2]: *** [all] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 ### Workaround By configuring and compiling in the directory "fontconfig-2.12.6" instead of "fontconfig-2.12.6-build", this problem of conflicting types can be avoided, and the "make" successfully completes. rm -r fontconfig-2.12.6-build rm -r fontconfig-2.12.6 tar -xpf fontconfig-2.12.6.tar.gz cd fontconfig-2.12.6 ./configure make ### Environment Fontconfig 2.12.6 Mac OS X Intel 64-bit
attach the config.log please. we don't ship fcobjshash.gperf anymore. thus it should be generated at the build time as well as fcobjshash.h where that error is coming from. however you have a conflict on the type of len. also check the timestamp for those files too.
confirmed the build with gperf-3.1 which generates the hash with size_t len and 3.0.4 which generates the hash with unsigned int len. If gperf isn't installed on the system, the build will simply be stopped. not like that reason. so this should be fixed. I don't know how you build fontconfig on your box and see that though, you probably misconfigured or may have both versions of gperf installed and referring different on configure and build. Anyway, closing.
This is still happening in fontconfig-2.13.0 when builddir != srcdir, as Comment 18 says. fcobjshash.h is indeed regenerated, but fcobjs.c has an #include "fcobjshash.h" which searchs in current file directory first, and therefore sees the shipped fcobjshash.h (in srcdir) and uses it, instead of the regenerated fcobjshash.h (in builddir). A possible solution is changing the quoting to: #include <fcobjshash.h> which would search system directories (finding nothing) and then the included directories in compile command line, which place builddir before srcdir. Another is not shippinh fcobjshash.h at all.
Indeed, removing src/fcobjshash.h from the srcdir seems to make everything work fine. I would recommend not shipping it in the tarball as well.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/10.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.