I must use gcc on OS/X for my project, because clang doesn't have some features I require.
I am trying to get JUCE to compile using gcc, without any success, and I'm not familiar enough with OS/X quirks to know what direction to go.
Has anyone successfully compiled JUCE on OS/X using gcc? Or alternatively, has anyone been able to compile JUCE as a dylib (or .a) with the default setup, and link to it with a gcc compiled app?
I thought perhaps upgrading gcc might help, but alas it doesn't. I'm using the 'brew' version of gcc-4.9.
Using g++-4.9, with the options "-std=c++0x -shared -mtune=native -march=core2 -fPIC -ffixed-r15 -D JUCE_MAC -D "MAC=1" -D "NDEBUG=1" -D "JUCE_APP_VERSION=1.0.0" -D "JUCE_APP_VERSION_HEX=0x10000" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../JuceLibraryCode/modules"
I see errors like:
Compiling juce_core.cpp
In file included from ../../JuceLibraryCode/modules/juce_core/juce_core.cpp:43:0:
../../JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h:47:4: warning: #import is a deprecated GCC extension [-Wdeprecated]
#import <Cocoa/Cocoa.h>
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8:0,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from ../../JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h:47,
from ../../JuceLibraryCode/modules/juce_core/juce_core.cpp:43:
/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:409:1: error: stray '@' in program
@class NSString, Protocol;
^
...many more such lines...
In file included from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h:24:0,
from /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h:28,
from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:28,
from /System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:7,
from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:138,
from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
from ../../JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h:47,
from ../../JuceLibraryCode/modules/juce_core/juce_core.cpp:43:
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h:30:22: error: expected declaration before end of line
#pragma pack(push, 2)
I'm hoping the problem is just command-line parameters to the compiler... any ideas?