Hi,
I am trying to use JUCE_MAC macro, but weirdly it does not seem that Introjucer defines it…
That is at least what I see in the generated Xcode project.
And when using it, I also see that in mac, the code #defined in this macro is not compiled.
Am I missing something?
Thx
Nathaniel
jules
May 1, 2016, 9:36am
2
You can see where it’s defined in juce_TargetPlatform.h. It uses other compiler flags to detect whether you’re using OSX
dacro
May 19, 2022, 2:18pm
3
But JUCE_MAC is not defined on macOS Monterey. When I use the macro it can not find the functions I used from this header:
#if defined JUCE_MAC
#include <pwd.h>
#endif
but this is working
#if defined (__APPLE_CPP__) || defined (__APPLE_CC__)
#include <pwd.h>
#endif
You first need to
#include “…/JuceLibraryCode/JuceHeader.h”
Rail
dacro
July 7, 2022, 10:10am
5
Of course we did include the header with #include <JuceHeader.h>
… but still the problem that JUCE_MAC
is not defined on macOS.
daniel
July 7, 2022, 11:16am
6
Just wanted to report, that it works here on Monterey 12.4
Please note that even on a Mac, when targeting iOS or iPhone simulator JUCE_MAC is intentionally not set, see here:
HTH