Background
I'm trying to use the LSGetApplicationForURL
API and found a very useful example here - how to get default mail client version on mac os x?
However, when I try to compile the code, I get this error:
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:53: error: declaration does not declare anything
When I opened up MachineExceptions around line 53, this is where I saw some declarations of unsignedwide
, which is a type that is defined in MacTypes.h
. I found out this was part of the Carbon Core framework.
For starters, I am only including the top-level headers in my code (in fact, using the exact sample code found in the example above). So, I'm not including / touching MachineException.h
or any of the other header files. Although, obviously there seems to be some dependencies that eventually lead to this error.
Some of the things I've tried / researched:
- I found out that Carbon Core has been deprecated in 10.8 (the version I'm using)- https://developer.apple.com/library/mac/#releasenotes/General/CarbonCoreDeprecations/
As a result, the
MacTypes.h
in the Carbon Core framework was rather anaemic, which conditionally includedMacTypes.h
from /usr/include/ - I've tried editing
MacTypes.h
(in the Carbon Core framework) and MachineExceptions.h to include MacTypes from /usr/include, per the information on the 'deprecated' page above. - Switched around the order of including the header files (worked for someone else while I was researching this).
- I am including the CoreFoundation and ApplicationServices frameworks in my makefile (using the '-framework' option)
Any feedback on this issue is greatly appreciated as I've spent many hours trying to sort this out. I apologize in advance if anything in here is fundamental / basic. I am very new to Mac OS programming and trying to understand how Frameworks are wired, also how to use them.
Thanks!