Mac XCode Memory File Not Found

I’m trying to build my audio synth plugin in Mac OSX Mojave in XCode and I am getting file not found for #include in juce_StandardHeader.h.

The odd thing is I have had no problem building my source in XCode over the last few years and this problem is now occurring even though I have not changed anything. The only thing different is a few files in my source code. I did not mess with any other JUCE settings or XCode settings. The projucer module paths appear to be correct.

I can’t do my next release until I resolve this so any help would be much appreciated and I will provide more data if needed. Here is the log text for the error.

warning: include path for stdlibc++ headers not found;
pass ‘-std=libc++’ on the command line to use the libc++ standard library
instead [-Wstdlibcxx-not-found]
In file included from
/Users/fathom/Documents/Fathom/Fathom/Source/Zeksum.cpp:2:
In file included from
/Users/fathom/Documents/Fathom/Fathom/Source/
…/JuceLibraryCode/JuceHeader.h:18:
In file included from …/…/…/JUCE/modules/juce_audio_basics/juce_audio_basics.h:60:
In file included from …/…/…/JUCE/modules/juce_core/juce_core.h:182:
…/…/…/JUCE/modules/juce_core/system/juce_StandardHeader.h:55:10:
fatal error: ‘memory’ file not found
#include [memory]
1 warning and 1 error generated.
The brackets around “memory” are the standard less than greater than characters.

Have you recently installed or updated Homebrew?

Can you please run xcode-select -p in Terminal?

Hi Thanks for responding.

I’m not familiar with Homebrew so its not something I would have installed intentionally.

When I run that terminal command I get the following:
xcode-select: error: unable to get active developer directory
use sudo xcode-select --switch path/to/Xcode.app to set one.

The error from xcode-select makes sense with the errors you are getting in Xcode.

Where is Xcode installed? If it is located at /Applications/Xcode.app (which is the standard location), you should run

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

That’s odd XCode is not in my Applications folder, it is in:
/Users/fathom/Downloads/Xcode.app

I suppose that is not important since it runs
but in regard to your command I did the following:
sudo xcode-select -s /Users/fathom/Downloads/Xcode.app/Contents/Developer

But it is asking for a password. Do you happen to know the password parameter, I tried -p but that is not it.

Are you the administrator of this computer? If not, you need to ask an administrator to perform that command.

It’s my machine only and I am the administrator. I have noticed in OSX that many commands which involve any OS related or application related activity requires the user login password so I am assuming that the command you are recommending needs a password parameter such as -p mypassword or -password mypassword. I’m not sure what that would.

Also, what kind of information were you intending to fetch with that command?

I don’t think xcode-select has an option to specify the password. When the command asks for the login password, you should be able to type it in Terminal.

No, I am unable to type anything in. What are we trying to achieve with this terminal command?

I checked all my JUCE paths which look correct. However I’m not sure where the memory file is located. Is that a system file which JUCE is not finding? Could be I need to specify a system path for OSX so JUCE can find the file. I’m a Windows guy not a Mac guy so I’m not sure how to do that.

It looks to me like the original source of the problem is in juce-core/system/juce_StandardHeader.h #include memory, where memory is between the standard less than greater than characters.

My guess is that this memory file location is not in the OSX path. So perhaps the solution is to find this file, display the current system path and add the location to the path. Like I said I’m not a Mac guy so not sure the right commands to do this.

Just following the instructions to fix the Xcode installation. -s is the same as --switch.

Is there a way to run the terminal in administrator mode so I don’t hit the wall on the password request?

This is your own password, not the password of an admin.
On Unixes and OSX sudo asks for admin privileges, you only need to verify your own identity. The property that you are allowed to run administrative commands is set in your system preferences.

Technically you can make your shell (terminal) run as administrator calling sudo su -i but I would discourage that, because it changes some other settings as well that you might be unaware of at the moment.

BTW: did you ever run Xcode or only in the terminal? I think if you run the Xcode as regular app it will install some additional tools that you might lack at the moment.

@FathomSynth this is what I get when I open Terminal and run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer:

I then type my password (which doesn’t show up in any way) and press the ENTER key:

Calling xcode-select -p confirms that it is now setup as specified:

If what you get doesn’t match these screenshots, feel free to make some (CMD + SHIFT + 4 + SPACE to capture a specific window) and share them here.

OK, That seemed to work, however it had no impact on the memory file not being found.

Have you restarted Xcode?

I went back to your first post, and I realized that I missed this earlier:

JUCE doesn’t support libstdc++ since JUCE 5.3.2 (more precisely Removed the OS X 10.5 and 10.6 deployment target options from the Pro… · juce-framework/JUCE@c7c26fa · GitHub). Which version of JUCE are you using?

Also, are you using Projucer on macOS or directly using the Xcode project generated by Projucer on Windows?

1 Like

On Mac I’m using JUCE Version 4.3.
Like I said this all use to work and I had not touched anything except my source.

I guess Xcode auto-updated itself without telling you, and now you are using a version of Xcode that doesn’t provide libstdc++.

You can either:

  • install an older version of Xcode (it seems that Xcode 10 removed support for libstdc++, so you could try Xcode 9.4),
  • or change the “C++ Library” setting in Projucer to “Use Default” or “LLVM libc++” (but not “GNU libc++”).

1 Like

If I set the C++ library to LLVM libc++ in XCode I get
Invalid deployment target for -stdlib=libc++.

It can’t find #include [memory]

Do you happen to know where this file is located of it was there?

Using “LLVM libc++” requires an “OSX Deployment Target” of 10.7 or higher.

The memory header would be located under <Xcode_application>/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/<macOSX_sdk>/usr/include, depending on where Xcode is actually located, and which MacOSX SDK is used.