liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.89k stars 286 forks source link

Allegro doesn't build for macOS lower than 10.8 anymore #1088

Open dos1 opened 5 years ago

dos1 commented 5 years ago
[ 35%] Building C object CMakeFiles/allegro.dir/src/macosx/osxgl.m.o
/usr/bin/clang -Dallegro_EXPORTS -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build/include -iframework //System/Library/Frameworks  -pipe -Os -fno-common -msse -W -Wall -Wpointer-arith -Wmissing-declarations -Wstrict-prototypes -DNDEBUG -arch x86_64 -mmacosx-version-min=10.7 -fPIC    -DALLEGRO_SRC  -DALLEGRO_LIB_BUILD -o CMakeFiles/allegro.dir/src/macosx/osxgl.m.o   -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/qzmouse.m:28:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/./osxgl.h:40:4: error: unknown type name 'CVDisplayLinkRef'; did you mean 'CGDisplayModeRef'?
   CVDisplayLinkRef display_link;
   ^~~~~~~~~~~~~~~~
   CGDisplayModeRef
//System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:17:31: note: 'CGDisplayModeRef' declared here
typedef struct CGDisplayMode *CGDisplayModeRef;
                              ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/qzmouse.m:225:4: warning: 'CGSetLocalEventsSuppressionInterval' is deprecated [-Wdeprecated-declarations]
   CGSetLocalEventsSuppressionInterval(0.0);
   ^
//System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h:372:19: note: 'CGSetLocalEventsSuppressionInterval' declared here
CG_EXTERN CGError CGSetLocalEventsSuppressionInterval(CFTimeInterval seconds)
                  ^
1 warning and 1 error generated.
make[2]: *** [CMakeFiles/allegro.dir/src/macosx/qzmouse.m.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 35%] Building C object CMakeFiles/allegro.dir/src/macosx/osx_app_delegate.m.o
/usr/bin/clang -Dallegro_EXPORTS -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/include -I/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build/include -iframework //System/Library/Frameworks  -pipe -Os -fno-common -msse -W -Wall -Wpointer-arith -Wmissing-declarations -Wstrict-prototypes -DNDEBUG -arch x86_64 -mmacosx-version-min=10.7 -fPIC    -DALLEGRO_SRC  -DALLEGRO_LIB_BUILD -o CMakeFiles/allegro.dir/src/macosx/osx_app_delegate.m.o   -c /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osx_app_delegate.m
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:28:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/./osxgl.h:40:4: error: unknown type name 'CVDisplayLinkRef'; did you mean 'CGDisplayModeRef'?
   CVDisplayLinkRef display_link;
   ^~~~~~~~~~~~~~~~
   CGDisplayModeRef
//System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:17:31: note: 'CGDisplayModeRef' declared here
typedef struct CGDisplayMode *CGDisplayModeRef;
                              ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxclipboard.m:27:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/./osxgl.h:40:4: error: unknown type name 'CVDisplayLinkRef'; did you mean 'CGDisplayModeRef'?
   CVDisplayLinkRef display_link;
   ^~~~~~~~~~~~~~~~
   CGDisplayModeRef
//System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:17:31: note: 'CGDisplayModeRef' declared here
typedef struct CGDisplayMode *CGDisplayModeRef;
                              ^
1 error generated.
make[2]: *** [CMakeFiles/allegro.dir/src/macosx/osxclipboard.m.o] Error 1
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1239:39: error: unknown type name 'CVDisplayLinkRef'; did you mean 'CGDisplayModeRef'?
static CVReturn display_link_callback(CVDisplayLinkRef display_link,
                                      ^~~~~~~~~~~~~~~~
                                      CGDisplayModeRef
//System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:17:31: note: 'CGDisplayModeRef' declared here
typedef struct CGDisplayMode *CGDisplayModeRef;
                              ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1265:4: warning: implicit declaration of function 'CVDisplayLinkCreateWithActiveCGDisplays' is invalid in C99 [-Wimplicit-function-declaration]
   CVDisplayLinkCreateWithActiveCGDisplays(&dpy->display_link);
   ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1266:4: warning: implicit declaration of function 'CVDisplayLinkSetOutputCallback' is invalid in C99 [-Wimplicit-function-declaration]
   CVDisplayLinkSetOutputCallback(dpy->display_link, &display_link_callback, dpy);
   ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1269:4: warning: implicit declaration of function 'CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext' is invalid in C99 [-Wimplicit-function-declaration]
   CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(dpy->display_link, ctx, pixel_format);
   ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1270:4: warning: implicit declaration of function 'CVDisplayLinkStart' is invalid in C99 [-Wimplicit-function-declaration]
   CVDisplayLinkStart(dpy->display_link);
   ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/allegro5-5.2.5.0/src/macosx/osxgl.m:1834:7: warning: implicit declaration of function 'CVDisplayLinkRelease' is invalid in C99 [-Wimplicit-function-declaration]
      CVDisplayLinkRelease(dpy->display_link);
      ^
5 warnings and 2 errors generated.
make[2]: *** [CMakeFiles/allegro.dir/src/macosx/osxgl.m.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build'
make[1]: *** [CMakeFiles/allegro.dir/all] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build'
make: *** [all] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_allegro5/allegro5/work/build" && /usr/bin/make -j7 -w all VERBOSE=ON 

Should we fix this or should we update README to point to 10.8 as minimal version?

NewCreature commented 5 years ago

Not sure exactly what's changed since the last time I tried to build Allegro several months ago, but I was getting a linker error referencing CVDisplayLinkRelease when building Allegro targeting MacOS 10.6 today. I was able to fix it by adding the CoreVideo framework to CMakeLists.txt.

tonyd85 commented 4 years ago

Do I need to build allegro on MacOS Catalina or can I just use the header files?

kamenkitanov commented 4 years ago

CVDisplayLinkRelease linker errors are also happening if you target Catalina right now.

pedro-w commented 3 years ago

Apologies for the delay. Is this still happening? I think this may be two issues, link errors as reported by @NewCreature / @kamenkitanov, and the original report which seems to be a missing definition at compile time when targeting 10.8. The former is also #1192 and hopefully fixed by #1204 (same change to CMakeLists as NC suggested) I'm not sure about the latter. It ought to be OK because CVDisplayLinkRef goes back to 10.3. It may just be missing #import <CoreVideo/CoreVideo.h> where we import the other frameworks (alosx.h), but I'm not sure how I can test such an old version.