Compile error on Mac
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2023-11-17
08:09 AM
- last edited on
‎2024-09-17
01:22 PM
by
Doreena Deng
Hi,
I'm getting a compile error on Mac:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/locale:2827:22: no member named 'GS_realloc' in namespace 'std'; did you mean simply 'GS_realloc'?
_Tp* __t = (_Tp*)std::realloc(__owns ? __b.get() : 0, __new_cap);
The same code compiles fine with MSVC on windows.
Anyone faced this error?
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-07-10 05:38 PM
Try the shortcut trick to "fool" your Xcode into the right path, it might work, the internal files if not the same are very similar and will still work.
I'd believe it has something to do with how the template made with cmake forces the compiler to restrict the compilation at this point.
GDL Developer
Experimenting with API
from Brazil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2024-07-10 06:36 PM - last edited Wednesday
Something that worked for me is to create a .pch (precompiled header file) with this content:
#include "GSRoot.hpp"
namespace std {
void* GS_realloc (void *userData, size_t newSize);
}
(from Ben Cohen) also add the file path to the pch file in the PREFIX_HEADER parameter. (in Building Settings).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday - last edited Wednesday
Hi Akos
Could you please provide some more information on adding the pch to the project..
I have created and added a .pch to my project and then enabled precompiled headers in Xcode - but still I am still getting this error..
I am getting a bit desperate - there for the question!!
Thanks In Advance..
UPDATE: Found the issue - I needed to also add the file path to the pch file in the PREFIX_HEADER parameter. (in Building Settings). once this was done.. all good..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wednesday
Hi Ben,
Happy to hear that 🙂 Sorry I forgot to mention that in the original post.
Best, Akos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
@Viktor Kovacs wrote:
This issue occurs because there was a change in the latest Xcode SDK that is not compatible with the Development Kit. Although earlier it was possible to always use the latest Xcode, unfortunately it's not the case anymore.
Hi Viktor - what is the nature of the incompatibility? Is it purely a compilation problem or is there an underlying technical issue with something like memory management?
Central Innovation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hey Ralph,
API headers most of the time include a header called GSMalloc.hpp
. This header introduces some macros:
#define calloc(n, s) GS_calloc(n, s)
#define malloc(s) GS_malloc(s)
#define free(p) GS_free(p)
#define realloc(p, s) GS_realloc(p, s)
Now with the latest macOS SDK they have switched from using simply malloc
to std::malloc
. So when GS headers come before macOS SDK headers, the compiler will get std::GS_malloc
after preprocessing, and this is not able to compile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Yeah, I've been able to work around that and currently using Xcode 16.2 for everything. My main concern is to ensure there aren't any deeper issues…
Central Innovation
- « Previous
- Next »
- « Previous
- Next »