Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure on macOS: error: conflicting types for 'scandir'; have 'int(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **))' #56

Open
barracuda156 opened this issue Aug 16, 2024 · 4 comments

Comments

@barracuda156
Copy link

	/bin/sh ../libtool --silent  --tag=CC   --mode=compile ccache /opt/local/bin/gcc-mp-14 -DHAVE_CONFIG_H -I. -I..  -I./main -I./parsers -I./dsl -DEXTERNAL_PARSER_LIST_FILE=\"../src/tagmanager/tm_parsers.h\" -DG_LOG_DOMAIN=\"CTags\"   -I/opt/local/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/at-spi-2.0 -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/fribidi -I/opt/local/include/harfbuzz -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGDK_DISABLE_DEPRECATION_WARNINGS -fvisibility=hidden -DGEANY_EXPORT_SYMBOL="__attribute__((visibility(\"default\")))" -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -pipe -Os -arch ppc -MT main/portable-scandir.lo -MD -MP -MF $depbase.Tpo -c -o main/portable-scandir.lo main/portable-scandir.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo main/promise.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ../libtool --silent  --tag=CC   --mode=compile ccache /opt/local/bin/gcc-mp-14 -DHAVE_CONFIG_H -I. -I..  -I./main -I./parsers -I./dsl -DEXTERNAL_PARSER_LIST_FILE=\"../src/tagmanager/tm_parsers.h\" -DG_LOG_DOMAIN=\"CTags\"   -I/opt/local/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/at-spi-2.0 -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/fribidi -I/opt/local/include/harfbuzz -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGDK_DISABLE_DEPRECATION_WARNINGS -fvisibility=hidden -DGEANY_EXPORT_SYMBOL="__attribute__((visibility(\"default\")))" -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -pipe -Os -arch ppc -MT main/promise.lo -MD -MP -MF $depbase.Tpo -c -o main/promise.lo main/promise.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo main/ptag.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ../libtool --silent  --tag=CC   --mode=compile ccache /opt/local/bin/gcc-mp-14 -DHAVE_CONFIG_H -I. -I..  -I./main -I./parsers -I./dsl -DEXTERNAL_PARSER_LIST_FILE=\"../src/tagmanager/tm_parsers.h\" -DG_LOG_DOMAIN=\"CTags\"   -I/opt/local/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/at-spi2-atk/2.0 -I/opt/local/include/at-spi-2.0 -I/opt/local/include/dbus-1.0 -I/opt/local/lib/dbus-1.0/include -I/opt/local/include/gtk-3.0 -I/opt/local/include/gio-unix-2.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/harfbuzz -I/opt/local/include/pango-1.0 -I/opt/local/include/fribidi -I/opt/local/include/harfbuzz -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/libpng16 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGDK_DISABLE_DEPRECATION_WARNINGS -fvisibility=hidden -DGEANY_EXPORT_SYMBOL="__attribute__((visibility(\"default\")))" -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -pipe -Os -arch ppc -MT main/ptag.lo -MD -MP -MF $depbase.Tpo -c -o main/ptag.lo main/ptag.c &&\
	mv -f $depbase.Tpo $depbase.Plo
main/portable-scandir.c:136:1: error: conflicting types for 'scandir'; have 'int(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **))'
  136 | scandir(const char *directory_name,
      | ^~~~~~~
In file included from main/portable-dirent_p.h:5,
                 from main/routines_p.h:17,
                 from main/portable-scandir.c:112:
/usr/include/dirent.h:118:5: note: previous declaration of 'scandir' with type 'int(const char *, struct dirent ***, int (*)(struct dirent *), int (*)(const void *, const void *))'
  118 | int scandir(const char *, struct dirent ***,
      |     ^~~~~~~
make[2]: *** [main/portable-scandir.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_geany/geany/work/geany-2.0/ctags'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_geany/geany/work/geany-2.0'
make: *** [all] Error 2
@elextr elextr transferred this issue from geany/geany Aug 16, 2024
@elextr
Copy link
Member

elextr commented Aug 16, 2024

Moved to Macos repository, hopefully you used the source from here.

@techee
Copy link
Member

techee commented Aug 16, 2024

@barracuda156 What exactly are you doing - are you trying to build Geany itself or something within Geany? The official instructions for building Geany are here:

https://github.com/geany/geany-osx/blob/master/README.md

@barracuda156
Copy link
Author

@barracuda156 What exactly are you doing - are you trying to build Geany itself or something within Geany? The official instructions for building Geany are here:

https://github.com/geany/geany-osx/blob/master/README.md

Geany itself from the MacPorts portfile.

The error is caused by a mismatching declaration in dirent header. MacOS had a different one prior to 10.8.

@techee
Copy link
Member

techee commented Aug 16, 2024

Geany itself from the MacPorts portfile.

OK, no idea, I think nobody uses MacPorts here. Better to report the problem there.

I'd suggest using the official macOS Geany binary from

https://www.geany.org/download/releases/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants