Xcode 2.4

A quick FYI - I just got myself a spanking new MacBook and downloaded the new xcode 2.4, and there’s a few things break in the latest juce build. I’ll fix this in the next release, but in the meantime, if anyone has problems, here’s a couple of things to change:

  • replace every instance of MAC_OS_X_VERSION_MAX_ALLOWED with MAC_OS_X_VERSION_MIN_REQUIRED

  • in juce_PlatformDefs.h, replace this section:

#ifdef JUCE_LINUX #define juce_isfinite(v) std::isfinite(v) #elif JUCE_MAC #if MACOS_10_2_OR_EARLIER #define juce_isfinite(v) __isfinite(v) #else #define juce_isfinite(v) std::isfinite(v) #endif #elif defined (JUCE_WIN32) && ! defined (isfinite) #define juce_isfinite(v) _finite(v) #else #define juce_isfinite(v) isfinite(v) #endif

// juce_PlatformDefs.h //

sp. “juce_MathsFunctions.h” ?

[quote=“Dub”]// juce_PlatformDefs.h //

sp. “juce_MathsFunctions.h” ?[/quote]

yeah, that’s what I meant…

When upgrading to 1.37 and XCode 2.4, I hit a problem when I installed the 10.2 SDK. Before, I had changed the xconfig file to 10.3, and when I used 10.2 (a fresh install) I had a lot of compile errors, notably that hypotf wasn’t defined. Going to the 10.3 SDK removes these problems. I think I have an isinfinite problem still, but I’ll recheck the above instructions.

Bruce

That “isinfinite” thing rings a bell, but I seem to recall it was fixed by one of Jule’s suggested changes (except to “juce_MathsFunctions.h” instead of “juce_PlatformDefs.h”), ONLY (i.e. I didn’t need to fiddle about with anything else at all).

I had the same problems at first… (I don’t think I’ve ever (knowingly) fiddled with xconfig) - but I (re-?) installed the SDK and 10.2, and (eventually) everything recompiled without any problems.

- s’funny - Perhaps that 10.2 SDK bit should be added to some build instructions (unless I missed them) - as recent compilers don’t include them on a typical install, anymore.

I did mess-up the search/replace a few times (remember I’m new to Macs & xcode). I re-unzipped the sources and tried again - I seem to recall having to select a few extra (?Text?) options on the search/replace options to get it to do what I wanted.

So far, I still have an isfinite problem:

/Juce Folder/juce/src/juce_core/text/juce_String.cpp:332: error: isfinite' undeclared in namespacestd’

Seems to be the only use. This seems related to the 10.2.8 versus 10.3 change.

I thing I made all the changes as described, and I have a fresh 10.2.8 SDK installed with XCode 2.4

Bruce

[quote=“Bruce Wheaton”]So far, I still have an isfinite problem:

/Juce Folder/juce/src/juce_core/text/juce_String.cpp:332: error: isfinite' undeclared in namespace std’

Seems to be the only use. This seems related to the 10.2.8 versus 10.3 change.

I thing I made all the changes as described, and I have a fresh 10.2.8 SDK installed with XCode 2.4

Bruce[/quote]

If you’re compiling on 10.2.8, using the code snippet I posted above, then it shouldn’t be using std::isfinite(), as you can see from the code. So I guess the MACOS_10_2_OR_EARLIER macro isn’t set correctly. Are you sure you replaced all the MAC_OS_X_VERSION_MAX_ALLOWED macros like I said?

I think I hadn’t at the time I tried the 10.3 SDK (which worked for me in 1.36). Going back to the 10.2.8 SDK seems fine now.

But - this error is with the 10.3 SDK. Could it be that isFinite should be defined based on below 10.4? Or is it a GCC change? 10.3 and GCC 3.3 hits that error.

I’ll stick with 10.2.8 now, but that doesn’t seem to be part of a default developer tools install any more.

Thanks,

Bruce

[quote=“Bruce Wheaton”]I think I hadn’t at the time I tried the 10.3 SDK (which worked for me in 1.36). Going back to the 10.2.8 SDK seems fine now.

But - this error is with the 10.3 SDK. Could it be that isFinite should be defined based on below 10.4? Or is it a GCC change? 10.3 and GCC 3.3 hits that error.

I’ll stick with 10.2.8 now, but that doesn’t seem to be part of a default developer tools install any more.

Thanks,

Bruce[/quote]

I’m sure I tested it with the 10.3 SDK, but I’ll double-check before the next release.

I’m seeing a similar error to Bruce:

juce::String::doubleToStringWithDecPlaces(double, int)’:
/Users/bobsellon/Projects/Shared/juce/src/juce_core/text/juce_String.cpp:332: error: `__isfinite’ undeclared (first use this function)
/Users/bobsellon/Projects/Shared/juce/src/juce_core/text/juce_String.cpp:332: error: (Each undeclared identifier is reported only once for each function it appears in.)

I’m a newbie to both the mac and XCode so, my applogies if I’m missing something obvious. Using XCode, I replaced all instances of MAC_OS_X_VERSION_MAX_ALLOWED in the project and made the change to juce_MathsFunctions.h. This is a brand new MacBook Pro with latest version of XTools installed (2.4) and SDKs 10.4u and 10.3.9 (10.3.9 selected). I tried to locate SDK 10.2.8 on the ADC page but couldn’t find it.

I’m dead in the water here so any suggeestions would be most appreciated.

Thanks,
Bob

Bob,

the two workarounds I found were to install the 10.2 SDK, or remove the PPC specific xconfig stuff, and your app will build targetted all the 10.4.

I suspect the actual problem is in the juce - isFinite definitions, where the GCC version or sdk needs to be set correctly for non-10.2 cases.

Bruce

This is actually a really easy fix - in the code in juce_MathsFunctions.h that I posted on this thread, just change the 10_2 to a 10_3, like this:

#ifdef JUCE_LINUX #define juce_isfinite(v) std::isfinite(v) #elif JUCE_MAC #if MACOS_10_3_OR_EARLIER #define juce_isfinite(v) __isfinite(v) #else #define juce_isfinite(v) std::isfinite(v) #endif #elif defined (JUCE_WIN32) && ! defined (isfinite) #define juce_isfinite(v) _finite(v) #else #define juce_isfinite(v) isfinite(v) #endif

Hi Jules, Thanks for the tip. That cleared up problem with the string file but I’m now getting several errors related to a MWERKS macro. Again, I’m a newbie to xcode so it’s possible I messed something up trying to solve the previous issue. The specific error is pasted below but I was wondering if anyone knew how to get the 10.2.8 SDK. I checked the apple developers download site and I don’t see it referenced anywhere. I’m suspecting that I need to download the old version of xcode and possibly install it to get the older sdk. I’ve even done google searches and came up empty.

By the way, thanks for your suggestions Bruce. Much appreciated.

The error shows up building juce_mac_CoreAudio.cpp:
from /Users/bobsellon/Projects/Shared/juce/build/macosx/platform_specific_code/…/…/…/src/juce_core/basics/juce_PlatformDefs.h:85,
from /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21,
from /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:20,
from /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:8,
In file included from /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:13,
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/stdbool.h:8:2: error: #error “This header only supports MWERKS.”


I’m also seeing some errors that look like they are related to include files in the MacOSK10.3.9.sdk folder:
In file included from /Developer/SDKs/MacOSX10.3.9.sdk/usr/include/c++/4.0.0/bits/stl_algobase.h:69,
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/c++/4.0.0/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
/Developer/SDKs/MacOSX10.3.9.sdk/usr/include/c++/4.0.0/iosfwd:46:25: error: bits/c++io.h: No such file or directory

These just might be include path issues though so I’ll do some more digging.

I’m also going to install the previous version of xcode since a newbie really shouldn’t be playing at the bleeding edge.

Thanks again, Bob

I must have messed something else up up in the project trying to track down the problems with 10.3.9 sdk. I finally found the 10.2.8 sdk in the XCode 2.3 image and did a clean install of the latest juce zip, applied Jules changes and it builds cleanly with XCode 2.4 (I didn’t install 2.3, just grabbed the sdk). - Bob

I gave up. I was unable to fix the isfinite problem, so I just
set it to:

#define juce_isfinite(v) /* */

That’ll do for now.

I tried all of the following alternatives, without any luck:

 #define juce_isfinite(v)      __isfinite(v)

and:

  #define juce_isfinite(v)      isfinite(v)

and:

  #define juce_isfinite(v)     std::isfinite(v)

and:

#include "/usr/include/architecture/i386/math.h"
#define juce_isfinite(v)      isfinite(v)

and:

#if defined(__GNUC__)
        #define HUGE_VAL        __builtin_huge_val()
        #define HUGE_VALF       __builtin_huge_valf()
        #define HUGE_VALL       __builtin_huge_vall()
#define NAN         __builtin_nanf("0x7fc00000") /* Constant expression, can be used as initializer. */
    #define __MATH_H_ALWAYS_INLINE__            __attribute__ ((always_inline))
#else
    #define     HUGE_VAL        1e500
    #define     HUGE_VALF       1e50f
    #define     HUGE_VALL       1e5000L
    #define NAN         __nan( )
    #define __MATH_H_ALWAYS_INLINE__
#endif

static __inline__  int __inline_isfinitef       (float      ) __MATH_H_ALWAYS_INLINE__;
static __inline__  int __inline_isfinited       (double     ) __MATH_H_ALWAYS_INLINE__;
static __inline__  int __inline_isfinite        (long double) __MATH_H_ALWAYS_INLINE__;

        #define isfinite(x)     \
                (       sizeof (x) == sizeof(float )    ?       __inline_isfinitef((float)(x))  \
                :       sizeof (x) == sizeof(double)    ?       __inline_isfinited((double)(x)) \
                                                                                        :       __inline_isfinite ((long double)(x)))

My latest attempt is:

#if MACOS_10_2_OR_EARLIER #define juce_isfinite(v) __isfinite(v) #elif MACOS_10_3_OR_EARLIER #ifdef isfinite #define juce_isfinite(v) isfinite(v) #else // no idea why the isfinite macro is sometimes impossible to include, so just copy the built-in one.. static __inline__ int juce_isfinite (double __x) { return __x == __x && __builtin_fabs (__x) != __builtin_inf(); } #endif #else #define juce_isfinite(v) std::isfinite(v) #endif

although even this causes problems when building an RTAS, so I’ve had to remove any uses of isinfinite from the juce code to avoid link errors.

Just a missive to say that (if you weren’t aware) XCode 2.4.1’s out -

I’ve upgraded, and rebuilt Juce and a VST Audio plugin (haven’t got round to anything else) with no issues or problems so far

And another to say there’s a new version of OSX tiger (10.4.10) up… in case you hadn’t noticed - No problems found, so far

Anyone had a chance to try against Beta Leopard yet?

Well, JUCE builds on Leopard/XCode 3 :slight_smile:

I’ve just started playing with changing the project-version to XCode3, and asked it to use 10.5 Leopard SDK… this causes some of my efforts suffer from uint8 not being recognized (changed to JUCE_NAMESPACE::uint8, and all’s fine)

BUT… I have a problem with building whole projects- {not really relevant here, but I’d be interested if anyone else has the same problem - I imagine someone out there is doing something similar to me} -

My master source is on a PC - (shared directory) - When I build the JUCE library, this is fine - When I build my plugin (based on the standard VST demo) the XCode hangs… badly. - Like, I have to power-down my machine :frowning:

If I manually compile each file of the projec, and then build (i.e. just link) - It’s OK!
I haven’t tried copying all the code over to the Mac to see if that proves whether it’s anything to do with network builds

BTW - Bootcamp / ASIO4ALL still works beautifully:)