Page 1 of 1

Cannot compile examples on ARM Mac (M2, Sequoia)

Posted: Tue Mar 11, 2025 8:47 pm
by MisutaaAsriel

I'm wanting to delve into 3DS homebrew, and I recently had the interesting idea of trying to use Swift Embedded to build against devkitARM. However, I can't even get the base C examples to compile as provided, let alone get Swift Embedded to build with the bridging header.

Running make from /opt/devkitpro/examples/3DS/graphics/printing/hello-world outputs this:

Code: Select all

main.c
In file included from /opt/devkitpro/libctru/include/3ds.h:25,
                 from /opt/devkitpro/examples/3ds/graphics/printing/hello-world/source/main.c:6:
/opt/devkitpro/libctru/include/3ds/synchronization.h:10:9: error: unknown type name '_LOCK_T'
   10 | typedef _LOCK_T LightLock;
      |         ^~~~~~~
/opt/devkitpro/libctru/include/3ds/synchronization.h:13:9: error: unknown type name '_LOCK_RECURSIVE_T'
   13 | typedef _LOCK_RECURSIVE_T RecursiveLock;
      |         ^~~~~~~~~~~~~~~~~
make[1]: *** [main.o] Error 1

Is there something I'm missing? I also tried running make via arch -x86_64 make just to see if it was an ARM vs AMD64 thing by running make through Rosetta 2, but it still fails the same way. How do I go about fixing this?

  • To note, trying to compile a Swift project reports errors like unknown argument: '-mword-relocations', which is interesting; -mword-relocations is one of the C compiler flags of the stock makefile, so it's strange it'd say the argument is unknown. Being said, this is mostly irrelevant as even the base C project will not compile on its own so any errors I get from Swift are likely erroneous in themselves.

I made sure to follow the instructions for installing dkp-pacman and the 3DS sdk & examples. I also made sure $DEVKITPRO & $DEVKITARM are properly set in my .zprofile for zsh.


Re: Cannot compile examples on ARM Mac (M2, Sequoia)

Posted: Tue Jul 01, 2025 12:05 am
by WinterMute

Running make from /opt/devkitpro/examples/3DS/graphics/printing/hello-world should in fact output this

Code: Select all

mkdir: build: Permission denied
make: *** [build] Error 1

The provided example code is not intended to compile in place but to be copied elsewhere. Nothing inside /opt/devkitpro is intended to be user modifiable.

The unknown type name '_LOCK_T' error and the unknown argument: '-mword-relocations' would indicate that you're not using devkitARM to compile which I struggle to imagine how that could happen unless you've modified other files inside /opt/devkitpro unless something else in your environment is interfering.

Start by removing your /opt/devkitpro folder then reinstall from scratch. Do not modify anything inside that folder. Copy /opt/devkitpro/examples/3DS/graphics/printing/hello-world somewhere else (I keep my projects in ~/projects) and run make from that copy. If you still get an error then show us the output of the env command (type env in your terminal then copy the output here inside code tags)