Skip to content

[BUG] Undefined symbols _MTLIOErrorDomain and _MTLTensorDomain on simulator after upgrading MLX (0.30.2) #341

@tqtifnypmb

Description

@tqtifnypmb

Describe the bug
After upgrading to the latest version of MLX, building my project for the iOS Simulator (arm64) fails with the following linker errors:

Undefined symbols for architecture arm64:
  "_MTLIOErrorDomain", referenced from:
      ___cxx_global_var_init.3775 in Cmlx.o
  "_MTLTensorDomain", referenced from:
      ___cxx_global_var_init.3746 in Cmlx.o

This issue only occurs when building for the simulator. Real device builds succeed without errors.

To Reproduce

It should be easy to reproduce.

Desktop (please complete the following information):

  • OS Version: MacOS 15.7.2, XCode 26.1.1
  • Device: iPhone 17 Simulator
  • Version 0.30.2

Additional context

There's an easy workaround:

#if TARGET_OS_SIMULATOR

#import <Foundation/Foundation.h>

NSErrorDomain MTLIOErrorDomain = @"MTLIOErrorDomain";
NSErrorDomain MTLTensorDomain = @"MTLTensorDomain";

#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions