Juce in iOS Project... weird compiler problem(s)

Hi Jules!

I’ve got two - no doubt, related! - problems including Juce library code in an iOS project.
NB: I’ve tagged the file to build with ARC turned-off.

In file included from ...../juce_core/juce_core.cpp:131:
.../modules/juce_audio_basics/../juce_core/network/juce_Socket.cpp:80:28: error: variable has incomplete type 'struct sockaddr_in'
        struct sockaddr_in servTmpAddr;
                           ^
..../modules/juce_audio_basics/../juce_core/network/juce_Socket.cpp:80:16: note: forward declaration of 'juce::SocketHelpers::sockaddr_in'
        struct sockaddr_in servTmpAddr;

And possibly related, I get this:

juce_amalgamated.cpp:37:
In file included from ..../modules/juce_graphics/juce_graphics.cpp:67:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:39:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h:14:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/include/MacTypes.h:133:8: error: redefinition of 'wide'
struct wide {
       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk/usr/include/MacTypes.h:133:8: note: previous definition is here
struct wide {

Have you any idea what might be going on? :slight_smile:

Best wishes,

Pete

I just fixed a couple of iOS compile problems… (May be unrelated)

Hi Jules,

Sounds great - let me know when in the repo, I’ll be very :slight_smile: happy to test! :slight_smile:

Best wishes,

Pete

Oh, the repo’s up-to-date, I don’t leave things lying around for too long!

Hi Jules,

Very weird - can’t seem to see a repo update since 3 Jun 2013…?!
14ec53de2e5d7e493c973ac0a2b91a8fb912e170

“WASPI: used mix format channel mask.”

I wonder what is going on with git?!

Pete

Sourceforge have changed all their URLs and left any old links broken and dysfunctional… new ones here: juce.com/downloads

Thanks Jules - see separate post in http://rawmaterialsoftware.com/viewtopic.php?f=2&t=11690 - I’ll move that discussion on git there - there is almost no history in the JUCE.git repo. :slight_smile:

Hi Jules,

Still didn’t work!

Also saw this bug in the code:

        if (audioCategory == kAudioSessionCategory_PlayAndRecord;
        {
...

Note the dangling ; at the end of the line! :wink:

Fingers crossed you can figure this one out!

Pete

If I change the code to this:

juce_Graphics.cpp

#elif JUCE_IOS
 #import <QuartzCore/QuartzCore.h>
// #import <CoreText/CoreText.h>

juce_mac_Fonts.cpp

// Add next three lines...!
#if JUCE_IOS
#import <CoreText/CoreText.h>
#endif // JUCE_IOS

static CTFontRef getCTFontFromTypeface (const Font& f);

namespace CoreTextTypeLayout

This clears almost all of the problems - but there are complaints about Points conflicting with Juce’s Point.

Finally, this reveals the following problem in the iOS Code:

void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool allowMenusAndBars)
{
    [[UIApplication sharedApplication] setStatusBarHidden: enableOrDisable
                                            withAnimation: UIStatusBarAnimationSlide];

    displays.refresh();

That should be displays->refresh() … see the compiler error below:

In file included from .../modules/juce_gui_basics/juce_gui_basics.cpp:270:
.../juce/modules/juce_audio_processors/../juce_gui_basics/native/juce_ios_UIViewComponentPeer.mm:939:13: error: no member named 'refresh' in 'juce::ScopedPointer<juce::Desktop::Displays>'; did you mean to use '->' instead of '.'?
    displays.refresh();

Best wishes,

Pete

[quote=“peteatjuce”]Hi Jules,

Still didn’t work!

Also saw this bug in the code:

        if (audioCategory == kAudioSessionCategory_PlayAndRecord;
        {
...

Note the dangling ; at the end of the line! :wink:

Fingers crossed you can figure this one out!

Pete[/quote]

But I fixed that yesterday… Thought you got the latest repo today?

(Damn, sorry, hadn’t pushed yesterday’s changes… Have done so now!)

Thanks Jules - all now sorted on this thread. :slight_smile:

Best wishes,

Pete