# Build iOS static library for x86\_64 (simulator) architecture on intel MacBookPro

**URL:** <https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248>\
**Category:** MacOSX and iOS\
**Created:** [July 20, 2024, 4:34pm UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248 "2024-07-20T16:34:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danie11am](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danie11am/32/18294_2.png) [@danie11am](https://forum.juce.com/u/danie11am)\
**Post date:** [July 20, 2024, 4:34pm UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/1 "2024-07-20T16:34:11Z")

</div>

Hi,

Has anyone tried and successfully built a JUCE iOS static library for x86\_64 architecture?

The context here is that I built a JUCE iOS static library for my iOS application. It works great except that I can’t run my app on simulator, because my MacBook Pro is an Intel machine with x86\_64 architecture which the simulators also follow, but the static library is only built for ARM architecture. My goal here is to build the library in x86\_64 so that I can run my app on simulators.

I have tried changing Xcode build settings ARCHS to x86\_64 and adding it to VALID\_ARCHS. But I got build error such as the screenshot below, where a macro in iOS `types.h` says that non-arm architecture is not supported. I feel like I’m missing some build settings perhaps?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/juce/original/3X/a/8/a8c1376d8db3cbedbf8bed57a8f64321e1f70498.png)

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [July 21, 2024, 10:49am UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/2 "2024-07-21T10:49:10Z")

</div>

This is pretty confusing - the simulator itself is an emulator that runs ARM apps regardless of whatever arch your computer is in, not sure why it would be different with a static library.

I don’t think you need to build an Intel version of your library to run the simulator and it likely won’t be possible anyway for iOS (since no iOS devices exist with an Intel CPU).

---

<div class="post-metadata">

**Author:** ![danie11am](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danie11am/32/18294_2.png) [@danie11am](https://forum.juce.com/u/danie11am)\
**Post date:** [July 21, 2024, 4:45pm UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/3 "2024-07-21T16:45:19Z")

</div>

Hey thanks for responding!

The reason I think the iOS static library needs to be built for x86\_64 is that…

If the JUCE iOS static library is kept the way it is (i.e. Architectures set to “Standard Architectures (arm64)”), when I try to build for say iPhone 15 simulator iOS 17.4, in the build log I would see lines like

```auto
Compile <file name> (x86_64) <...> seconds

```

… for all the files getting compiled. Going through the error message in detail I could see

```auto
Undefined symbols for architecture x86_64:
  "juce::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_debug_mode()", referenced from:

```

That assert failure from `juce_core.cpp` might look like the cause but I don’t think it is, because in this situation it would build and run fine once I change the run destination to my iPhone device. The real cause seems to be “Undefined symbols for architecture x86\_64”.

I also found notes like the following:

- [https://www.quora.com/Why-do-I-need-x86\_64-architecture-under-xcode-while-compiling-an-iOS-app](https://www.quora.com/Why-do-I-need-x86_64-architecture-under-xcode-while-compiling-an-iOS-app)
- [Reddit - Dive into anything](https://www.reddit.com/r/iOSProgramming/comments/lxfro0/comment/gpmvs2w)

---

<div class="post-metadata">

**Author:** ![eyalamir](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/eyalamir/32/2978_2.png) [@eyalamir](https://forum.juce.com/u/eyalamir)\
**Post date:** [July 21, 2024, 8:08pm UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/4 "2024-07-21T20:08:09Z")

</div>

1. JUCE in general doesn’t love static libs. I would suggest to just build a regular JUCE app on iOS for simplicity (and that will work on the simulator as well on device).

2. I’m not sure why would that be the case - a JUCE build for iOS should be building ARM and ARM only, I would go over your setting up steps as ‘just the default’ should compile the library correctly. At least with an app and not a library, this should work.

---

<div class="post-metadata">

**Author:** ![danie11am](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danie11am/32/18294_2.png) [@danie11am](https://forum.juce.com/u/danie11am)\
**Post date:** [July 22, 2024, 1:04am UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/5 "2024-07-22T01:04:11Z")

</div>

When you said “just build a regular JUCE app”, I believe it meant building the UI using only the JUCE framework? That’s not sufficient for my use case unfortunately.

---

<div class="post-metadata">

**Author:** ![danie11am](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danie11am/32/18294_2.png) [@danie11am](https://forum.juce.com/u/danie11am)\
**Post date:** [July 22, 2024, 8:07am UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/6 "2024-07-22T08:07:36Z")

</div>

I found it! It’s actually really simple - when building the static library, I overlooked the option in Run Destination “Any iOS Simulator Device (arm64, x86\_64)”. Once that is chosen, the resultant `.a` file would work in simulators. 🙂

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [July 22, 2024, 10:09am UTC](https://forum.juce.com/t/build-ios-static-library-for-x86-64-simulator-architecture-on-intel-macbookpro/62248/7 "2024-07-22T10:09:53Z")

</div>

> 1. I’m not sure why would that be the case - a JUCE build for iOS should be building ARM and ARM only, I would go over your setting up steps as ‘just the default’ should compile the library correctly. At least with an app and not a library, this should work.

Worth clarifying…  
Apple DOES have 3 ABIs now (following arm and macOS is now always 64bit):

- x86\_64 Simulator
- arm64 Simulator
- arm64

I guess I could find more details but this document I read lately explained it quite nice:

> **[PEP 730 – Adding iOS as a supported platform | peps.python.org](https://peps.python.org/pep-0730/)**
>
> This PEP proposes adding iOS as a supported platform in CPython. The initial goal is to achieve Tier 3 support for Python 3.13. This PEP describes the technical aspects of the changes that are required to support iOS. It also describes the project...
