Native Extensions


Similar problem with Defos NE after 1.2.123 update. Looks like there is a breaking changes on MacOSX10.13 sdk

clang++ -c -arch x86_64 -target x86_64-apple-darwin12 -isysroot /opt/MacOSX10.13.sdk/ -m64 -O2 -g -mmacosx-version-min=10.7 -DDM_PLATFORM_OSX -DLUA_BYTECODE_ENABLE   -Iupload/defos/include   -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//include -I/var/extender/sdk/46d8b7e63d7e0f0f4acd545c46d25ca2b227a806/defoldsdk//sdk/include  upload/defos/src/ -obuild/defos_mac.mm_3.o
In file included from upload/defos/src/
In file included from /opt/MacOSX10.13.sdk//System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:
In file included from /opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:128:
/opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:26:49: error: nullability specifier '_Nullable' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
/opt/MacOSX10.13.sdk//System/Library/Frameworks/Foundation.framework/Headers/NSUUID.h:29:30: error: nullability specifier '_Nonnull' cannot be applied to non-pointer type 'uuid_t' (aka 'unsigned char [16]')
- (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
2 errors generated.


I’m looking into this. Not sure why this fails :confused:

Current workarounds:


I heard there’s a Native Extension build server that Defold provides. I’m trying to understand the big picture concept of NE’s and building them.

Why is a build server needed? Is it always used, if you have a NE in your project?

For example, the FMOD extension by dapetcu21 - it is using bridge libraries that are pre-built in Visual Studio. Are the build servers not required in this case? But still used? Or not?

Are there multiple build steps to consider?

I’m lacking C++ experience but think it’s probably good to know what happens when.


Native extensions allows you, the user, to extend the engine with extra functionality. It can be a sound library, or an ads library, or something that interacts with the OS.

If your project contains a native extension, or has a dependency on one, we will build a custom engine for you, on our cloud server.


I am not sure but the old version of clang can be the reason of this bug (some info here and here)


I was initially compiling my own libs to remove the need to bundle the FMOD headers with the dependency (as I was not authorized to distribute them). Now that I am authorized to distribute FMOD, I decided to still keep this structure because the Lua bindings have a lot of glue code (with lots of templates and macros) that is slow to compile and I’d like not to have to make tea each time I build the game. :wink:

The build server is perfectly capable of compiling all of that stuff (weeeelll… eeeexcept on Windows, where I managed to make that particular version of the MSVC compiler crash), but I’m free to link against libraries I compiled on my own.

The build server is still needed to link the whole binary together with the Defold engine.

Also, the rationale behind having a build server is so that everybody can bundle for any platform no matter the OS they’re bundling from and without having to set up a complicated cross-compiler toolchain.


Thanks, great explanation!


@AGulev @selimanac @joshua.winters The server has been updated with a bug fix, and it now “works for me”. Could any of you verify the fix as well?


I checked DefUnityAds - it works!


Works for me too