Opened 12 years ago

Closed 12 years ago

#35177 closed defect (fixed)

mplayer2 fails to compile: conflicting types for 'Cursor'

Reported by: samuel.bateman@… Owned by: neverpanic (Clemens Lang)
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: haspatch Cc: sasoph@…
Port: mplayer2

Description

Trying to install the mplayer2 port, I get this error:

:info:build /usr/bin/gcc-4.2 -MD -MP -Wundef   -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -std=gnu99  -pipe -O2 -arch x86_64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -falign-loops=16 -shared-libgcc -mdynamic-no-pic -I.  -I/opt/local/include -I/opt/local/include/freetype2 -O2 -arch x86_64 -Wno-pointer-sign -I/opt/local/include -I/opt/local/include/freetype2 -DPIC  -I/usr/X11/include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/opt/local/include -I/opt/local/include/fribidi -I/opt/local/include/freetype2   -I/opt/local/include -I/opt/local/include/libdvdread -c -o libvo/vo_corevideo.o libvo/vo_corevideo.m
:info:build In file included from /opt/local/include/X11/Xlib.h:44,
:info:build                  from libvo/gl_common.h:41,
:info:build                  from libvo/vo_corevideo.m:38:
:info:build /opt/local/include/X11/X.h:103: error: conflicting types for 'Cursor'
:info:build /System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:267: error: previous declaration of 'Cursor' was here
:info:build make: *** [libvo/vo_corevideo.o] Error 1

There seems to be some naming conflict with an X library.

Attachments (12)

main.log (112.2 KB) - added by samuel.bateman@… 12 years ago.
installed.log (16.1 KB) - added by samuel.bateman@… 12 years ago.
Output of "port installed"
mplayer2-vo_corevideo-x11-naming-conflict.patch (880 bytes) - added by neverpanic (Clemens Lang) 12 years ago.
Patch against $(port dir mplayer2)
main.2.log (150.7 KB) - added by sasoph@… 12 years ago.
main_after_patch.log (166.0 KB) - added by samuel.bateman@… 12 years ago.
main.log after applying patch mplayer2-vo_corevideo-x11-naming-conflict.patch
mplayer2-vo_corevideo-x11-naming-conflict.2.patch (1.5 KB) - added by neverpanic (Clemens Lang) 12 years ago.
Patch against $(port dir mplayer2)
main.3.log (151.7 KB) - added by sasoph@… 12 years ago.
Second patch applied
mplayer2-vo_corevideo-disable-x11.patch (665 bytes) - added by samuel.bateman@… 12 years ago.
disable x11 and xv in mplayer2 configure
main.4.log (326.2 KB) - added by sasoph@… 12 years ago.
mplayer2-vo_corevideo-disable-x11.patch applied
mplayer2-disable-x11.patch (2.5 KB) - added by neverpanic (Clemens Lang) 12 years ago.
mplayer2-appkit-fix-for-10.5.patch (1020 bytes) - added by samuel.bateman@… 12 years ago.
main.5.log (322.8 KB) - added by sasoph@… 12 years ago.
mplayer2-appkit-fix-for-10.5.patch applied

Download all attachments as: .zip

Change History (31)

Changed 12 years ago by samuel.bateman@…

Attachment: main.log added

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to cal@…

comment:2 Changed 12 years ago by neverpanic (Clemens Lang)

I cannot reproduce this. What version of OS X are you using?

Changed 12 years ago by samuel.bateman@…

Attachment: installed.log added

Output of "port installed"

comment:3 in reply to:  2 Changed 12 years ago by samuel.bateman@…

Replying to cal@…:

I cannot reproduce this. What version of OS X are you using?

I am using a Mac Pro with OS X 10.6.8. My Xcode version is 3.2.6. I have also attached the output from "port installed", in case it matters.

Thanks for looking into this.

Changed 12 years ago by neverpanic (Clemens Lang)

Patch against $(port dir mplayer2)

comment:4 Changed 12 years ago by neverpanic (Clemens Lang)

Cc: sasoph@… added
Keywords: haspatch added

Can you try the attached patch against the port directory of mplayer2, i.e.

cd $(port dir mplayer2)
curl -OL http://trac.macports.org/raw-attachment/ticket/35177/mplayer2-vo_corevideo-x11-naming-conflict.patch
patch -p0 <mplayer2-vo_corevideo-x11-naming-conflict.patch
sudo port clean mplayer2

and retry?

Has (partial) duplicate #35166.

Changed 12 years ago by sasoph@…

Attachment: main.2.log added

comment:5 Changed 12 years ago by sasoph@…

10.5.8 PPC, Xcode 3.1.4

mplayer2 with the patch, gives an error:

/usr/bin/gcc-4.0 -MD -MP -Wundef   -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -std=gnu99  -O2 -arch ppc -maltivec -mabi=altivec -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -falign-loops=16 -shared-libgcc -mdynamic-no-pic -I.  -I/opt/local/include -I/opt/local/include/freetype2 -O2 -arch ppc -Wno-pointer-sign -I/opt/local/include -I/opt/local/include/freetype2  -I/usr/X11/include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/opt/local/include -I/opt/local/include/fribidi -I/opt/local/include/freetype2   -I/opt/local/include -I/opt/local/include/libdvdread -c -o libvo/vo_corevideo.o libvo/vo_corevideo.m
In file included from /opt/local/include/X11/Xlib.h:44,
                 from libvo/gl_common.h:41,
                 from libvo/vo_corevideo.m:40:
/opt/local/include/X11/X.h:103: error: conflicting types for 'Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: previous declaration of 'Cursor' was here
make: *** [libvo/vo_corevideo.o] Error 1

Changed 12 years ago by samuel.bateman@…

Attachment: main_after_patch.log added

main.log after applying patch mplayer2-vo_corevideo-x11-naming-conflict.patch

comment:6 Changed 12 years ago by samuel.bateman@…

I am also getting the same error after applying the patch. I'm not sure what #define NO_X11_INCLUDES does, since grep shows no other use of that define:

$ grep -R NO_X11_INCLUDES work/mplayer2-2.0-20120606/
grep: work/mplayer2-2.0-20120606/DOCS/xml/it/skin.xml: No such file or directory
grep: work/mplayer2-2.0-20120606/DOCS/xml/zh_CN/skin.xml: No such file or directory
work/mplayer2-2.0-20120606/libvo/vo_corevideo.m:#define NO_X11_INCLUDES

Changed 12 years ago by neverpanic (Clemens Lang)

Patch against $(port dir mplayer2)

comment:7 Changed 12 years ago by neverpanic (Clemens Lang)

My bad, please try again with the updated patch mplayer2-vo_corevideo-x11-naming-conflict.2.patch.

comment:8 Changed 12 years ago by sasoph@…

I'm still getting a similar error:

/usr/bin/gcc-4.0 -MD -MP -Wundef   -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -std=gnu99  -O2 -arch ppc -maltivec -mabi=altivec -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -falign-loops=16 -shared-libgcc -mdynamic-no-pic -I.  -I/opt/local/include -I/opt/local/include/freetype2 -O2 -arch ppc -Wno-pointer-sign -I/opt/local/include -I/opt/local/include/freetype2  -I/usr/X11/include -I/opt/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/opt/local/include -I/opt/local/include/fribidi -I/opt/local/include/freetype2   -I/opt/local/include -I/opt/local/include/libdvdread -c -o libvo/vo_corevideo.o libvo/vo_corevideo.m
In file included from /opt/local/include/X11/Xlib.h:44,
                 from /opt/local/include/GL/glx.h:38,
                 from libvo/gl_common.h:41,
                 from libvo/vo_corevideo.m:40:
/opt/local/include/X11/X.h:103: error: conflicting types for 'Cursor'
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawTypes.h:269: error: previous declaration of 'Cursor' was here
make: *** [libvo/vo_corevideo.o] Error 1

Changed 12 years ago by sasoph@…

Attachment: main.3.log added

Second patch applied

Changed 12 years ago by samuel.bateman@…

disable x11 and xv in mplayer2 configure

comment:9 Changed 12 years ago by samuel.bateman@…

Even with the second patch which doesn't include "x11_common.h", there is still a naming error because of the include "GL/glx.h".

Maybe support for X11 and/or GLX should simply be disabled in the configure flags. X11 and Carbon/Quartz are sort of incompatible anyway.

I've attached a patch for the Portfile with "--disable-x11" and "--disable-xv", which I was able to successfully get to compile on my system.

comment:10 Changed 12 years ago by sasoph@…

mplayer2-vo_corevideo-disable-x11.patch returns this error:

libvo/cocoa_common.m:43: error: cannot find protocol declaration for 'NSWindowDelegate'
libvo/cocoa_common.m: In function 'vo_cocoa_init':
libvo/cocoa_common.m:142: error: 'NSApplicationActivationPolicyRegular' undeclared (first use in this function)
libvo/cocoa_common.m:142: error: (Each undeclared identifier is reported only once
libvo/cocoa_common.m:142: error: for each function it appears in.)
libvo/cocoa_common.m:142: warning: no '-setActivationPolicy:' method found
libvo/cocoa_common.m:142: warning: (Messages without a matching method signature
libvo/cocoa_common.m:142: warning: will be assumed to return 'id' and accept
libvo/cocoa_common.m:142: warning: '...' as arguments.)
libvo/cocoa_common.m: In function 'vo_cocoa_uninit':
libvo/cocoa_common.m:150: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:150: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m: In function '-[GLMPlayerWindow fullscreen]':
libvo/cocoa_common.m:417: error: 'NSApplicationPresentationHideDock' undeclared (first use in this function)
libvo/cocoa_common.m:417: error: 'NSApplicationPresentationHideMenuBar' undeclared (first use in this function)
libvo/cocoa_common.m:417: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m:420: warning: 'GLMPlayerWindow' may not respond to '-setStyleMask:'
libvo/cocoa_common.m:427: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:427: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m:429: warning: 'GLMPlayerWindow' may not respond to '-setStyleMask:'
libvo/cocoa_common.m: In function '-[GLMPlayerWindow applicationWillBecomeActive:]':
libvo/cocoa_common.m:573: error: 'NSApplicationPresentationHideDock' undeclared (first use in this function)
libvo/cocoa_common.m:574: error: 'NSApplicationPresentationHideMenuBar' undeclared (first use in this function)
libvo/cocoa_common.m:574: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m: In function '-[GLMPlayerWindow applicationWillResignActive:]':
libvo/cocoa_common.m:581: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:581: warning: no '-setPresentationOptions:' method found
make: *** [libvo/cocoa_common.o] Error 1

comment:11 Changed 12 years ago by neverpanic (Clemens Lang)

sasoph, it seems unlikely that disabling x11 would cause problems with undeclared Cocoa data structures. Please clean mplayer2 and re-try and attach your main.log if it still fails.

Samuel, the patch works fine for me on Lion, but that doesn't tell anything, because it worked fine for me before disabling x11, too. I'll wait for sasoph's feedback if you don't mind.

Also, disabling x11 probably means a number of dependencies can be dropped from the Portfile. I'll need more time to look into what can be removed (unless you want to?).

comment:12 Changed 12 years ago by sasoph@…

10.5.8 PPC, Xcode 3.1.4

Here's my procedure:
sudo port sync

# Deactivate conflicting ports
sudo port deactivate mplayer-devel
#2 Force, as gegl depends on it
sudo port -f deactivate ffmpeg

sudo port activate ffmpeg-devel

cd $(port dir mplayer2)
sudo curl -OL https://trac.macports.org/raw-attachment/ticket/35177/mplayer2-vo_corevideo-disable-x11.patch
sudo patch -p0 <mplayer2-vo_corevideo-disable-x11.patch
sudo port clean mplayer2

sudo port -v install mplayer2

Same error as above.

Changed 12 years ago by sasoph@…

Attachment: main.4.log added

mplayer2-vo_corevideo-disable-x11.patch applied

comment:13 Changed 12 years ago by neverpanic (Clemens Lang)

I don't know why this fails for you… NSWindowDelegate is defined in /System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h, which should be included from /System/Library/Frameworks/AppKit.framework/Versions/C/Headers/AppKit.h, which should be included from /System/Library/Frameworks/Cocoa.framework/Versions/A/Headers/Cocoa.h, which is included from cocoa_common.m in line 20. (NB: I checked this in the 10.6 SDK on Lion, not against the versions shipped with Lion).

Are you sure your Xcode installation is complete?

Samuel, I'm attaching a patch against the Portfile that should completely disable X11 and also remove the unnecessary dependencies. Can you test whether this still builds for you?

Changed 12 years ago by neverpanic (Clemens Lang)

Attachment: mplayer2-disable-x11.patch added

comment:14 Changed 12 years ago by sasoph@…

I've found all the files and references you mentioned, so do you still think my Xcode is at fault?

/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSWindow.h:
@interface NSObject(NSWindowDelegate)

/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/AppKit.h:
#import <AppKit/NSWindow.h>

/System/Library/Frameworks/Cocoa.framework/Versions/A/Headers/Cocoa.h:
#import <AppKit/AppKit.h>

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_mplayer2/mplayer2/work/mplayer2-2.0-20120606/libvo/cocoa_common.m
#import <Cocoa/Cocoa.h>

Changed 12 years ago by samuel.bateman@…

comment:15 Changed 12 years ago by samuel.bateman@…

cal, your patch works for me. mplayer2 compiles fine after applying it.

sasoph, a quick Google search reveals this (https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/NSWindowDelegate_Protocol/Reference/Reference.html): "Available in OS X v10.6 and later."

But you are using 10.5. I've attached a patch based on the workaround found here (http://forum.jogamp.org/Mac-OS-X-10-5-compile-error-td858747.html).

sasoph, could you try this? First, apply the mplayer2-disable-x11.patch, then apply the mplayer2-appkit-fix-for-10.5.patch, then try building again.

comment:16 Changed 12 years ago by neverpanic (Clemens Lang)

Commited mplayer2-disable-x11.patch in r95853.

I'm leaving this open to fix the appkit issue, too.

comment:17 Changed 12 years ago by sasoph@…

Since cal has committed -disable-x11.patch, I assumed that I only need use -appkit-fix-for-10.5.patch.

If so, there are more errors:

libvo/cocoa_common.m: In function 'vo_cocoa_init':
libvo/cocoa_common.m:146: error: 'NSApplicationActivationPolicyRegular' undeclared (first use in this function)
libvo/cocoa_common.m:146: error: (Each undeclared identifier is reported only once
libvo/cocoa_common.m:146: error: for each function it appears in.)
libvo/cocoa_common.m:146: warning: no '-setActivationPolicy:' method found
libvo/cocoa_common.m:146: warning: (Messages without a matching method signature
libvo/cocoa_common.m:146: warning: will be assumed to return 'id' and accept
libvo/cocoa_common.m:146: warning: '...' as arguments.)
libvo/cocoa_common.m: In function 'vo_cocoa_uninit':
libvo/cocoa_common.m:154: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:154: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m: In function '-[GLMPlayerWindow fullscreen]':
libvo/cocoa_common.m:421: error: 'NSApplicationPresentationHideDock' undeclared (first use in this function)
libvo/cocoa_common.m:421: error: 'NSApplicationPresentationHideMenuBar' undeclared (first use in this function)
libvo/cocoa_common.m:421: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m:424: warning: 'GLMPlayerWindow' may not respond to '-setStyleMask:'
libvo/cocoa_common.m:431: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:431: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m:433: warning: 'GLMPlayerWindow' may not respond to '-setStyleMask:'
libvo/cocoa_common.m: In function '-[GLMPlayerWindow applicationWillBecomeActive:]':
libvo/cocoa_common.m:577: error: 'NSApplicationPresentationHideDock' undeclared (first use in this function)
libvo/cocoa_common.m:578: error: 'NSApplicationPresentationHideMenuBar' undeclared (first use in this function)
libvo/cocoa_common.m:578: warning: no '-setPresentationOptions:' method found
libvo/cocoa_common.m: In function '-[GLMPlayerWindow applicationWillResignActive:]':
libvo/cocoa_common.m:585: error: 'NSApplicationPresentationDefault' undeclared (first use in this function)
libvo/cocoa_common.m:585: warning: no '-setPresentationOptions:' method found
make: *** [libvo/cocoa_common.o] Error 1

Changed 12 years ago by sasoph@…

Attachment: main.5.log added

mplayer2-appkit-fix-for-10.5.patch applied

comment:18 Changed 12 years ago by samuel.bateman@…

It seems like the cocoa_common.m file contains a lot of code which uses AppKit functionality not available in OS X versions < 10.6. For instance, everything related to the "PresentationOptions", which is used to implement fullscreen support.

I have never done any Cocoa and/or Objective-C programming before, so I don't know what (if anything) can be done to make this work in 10.5.

comment:19 Changed 12 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: newclosed

It doesn't seem there's anything I can do here to make mplayer2 work on 10.5. Try reporting upstream or adapting the Portfile to disable the offending parts (probably --disable-cocoa).

If you can come up with a patch to fix the build on 10.5 I'll be happy to apply it.

Note: See TracTickets for help on using tickets.