Homebrew Misc make: *** No rule to make target '/devkitpro/libnx/switch_rules'. Stop.

  • Thread starter Thread starter BurAndBY
  • Start date Start date
  • Views Views 5,556
  • Replies Replies 15

BurAndBY

Member
Newcomer
Joined
Dec 27, 2020
Messages
17
Reaction score
7
Trophies
0
Age
45
XP
212
Country
Belarus
I'm trying to build a custom project and it gives out this error
Rich (BB code):
make: *** No rule to make target '/devkitpro/libnx/switch_rules'.  Stop.
 
libnx was updated recently, and it's not via pacman. you have to go to its github and make install it there (not sure if it includes switch rules or not). okay, it does:

1677853727301.png
 
  • Like
Reactions: binkinator
libnx was updated recently, and it's not via pacman. you have to go to its github and make install it there (not sure if it includes switch rules or not). okay, it does:

View attachment 356835
How do I update it (I'm using Github Codespaces' Ubuntu)
Post automatically merged:

P.S.: I've fixed this error but now I'm getting
Makefile:
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/ld: required symbol `main' not defined
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/libnx/lib/libnx.a(switch_crt0.o): in function `_start':
/home/fincs/git/pacman-packages/libnx/src/libnx-4.2.2/nx/source/runtime/switch_crt0.s:70: undefined reference to `main'
collect2: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/libnx/switch_rules:80: /workspaces/nxray-16/nxray-16.elf] Error 1
make: *** [Makefile:165: build] Error 2
 
How do I update it (I'm using Github Codespaces' Ubuntu)
Post automatically merged:

P.S.: I've fixed this error but now I'm getting
Makefile:
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/ld: required symbol `main' not defined
/opt/devkitpro/devkitA64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/ld: /opt/devkitpro/libnx/lib/libnx.a(switch_crt0.o): in function `_start':
/home/fincs/git/pacman-packages/libnx/src/libnx-4.2.2/nx/source/runtime/switch_crt0.s:70: undefined reference to `main'
collect2: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/libnx/switch_rules:80: /workspaces/nxray-16/nxray-16.elf] Error 1
make: *** [Makefile:165: build] Error 2
Have you gone through the how to build atmosphere tutorial by @impeeza ?

https://gbatemp.net/threads/building-atmosphere-on-windows-using-msys2.613446/

it’s for Windows but the instructions are easily translated to Linux. Once you can build Atmosphere properly then you are assured to be able to build almost anything else relatively trouble free on a proven environment.

e: https://docs.github.com/en/billing/...odespaces/about-billing-for-github-codespaces

this is actually pretty cool. I do my builds on a raspberry pi…I might switch to a free code space. Hmmmm
 
Have you gone through the how to build atmosphere tutorial by @impeeza ?

https://gbatemp.net/threads/building-atmosphere-on-windows-using-msys2.613446/

it’s for Windows but the instructions are easily translated to Linux. Once you can build Atmosphere properly then you are assured to be able to build almost anything else relatively trouble free on a proven environment.

e: https://docs.github.com/en/billing/...odespaces/about-billing-for-github-codespaces

this is actually pretty cool. I do my builds on a raspberry pi…I might switch to a free code space. Hmmmm
For building Atmosphère on UBUNTU, I had to run this commands:

DevKitPro Installation
Bash:
sudo apt install wget
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman


Base packages
Bash:
sudo apt install lz4 zip git make gcc python3 python-is-python3 python3-pip
sudo pip install pycryptodome lz4
sudo dkp-pacman -Sy --noconfirm --needed libnx devkitA64 devkitARM devkitarm-rules hactool switch-dev dkp-toolchain-vars switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2 switch-libjpeg-turbo switch-glm
sudo dkp-pacman -Syuu --noconfirm

You need to copy prod.keys file on $HOME/.switch

Building
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere
cd Atmosphere
make -j$(nproc)
 
my guess is that it's the cross compiler (gcc). I'd do pacman -Syu switch-dev . either don't do libnx from there or redo the make install from the github version afterwards. it might be easier doing the latter, because you'd want everything else installed.
 
For building Atmosphère on UBUNTU, I had to run this commands:

DevKitPro Installation
Bash:
sudo apt install wget
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman


Base packages
Bash:
sudo apt install lz4 zip git make gcc python3 python-is-python3 python3-pip
sudo pip install pycryptodome lz4
sudo dkp-pacman -Sy --noconfirm --needed libnx devkitA64 devkitARM devkitarm-rules hactool switch-dev dkp-toolchain-vars switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2 switch-libjpeg-turbo switch-glm
sudo dkp-pacman -Syuu --noconfirm

You need to copy prod.keys file on $HOME/.switch

Building
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere
cd Atmosphere
make -j$(nproc)
I can build Atmo just fine, the problem is in my project
 
What does Error 1/2 mean and is there a guide/error documentation?
I'm not sure in this case. I didn't let it stop with failure, I just exited out, because it was pointless at that time. if I had to guess what the problem was, it was some sort of variable in the code that confused the compiler. maybe the compiler is the wrong version? however, that last thing in the dependencies only seems to exist with ubuntu 22.04, so it's probably not something to do with the linux distro.
 
I'm not sure in this case. I didn't let it stop with failure, I just exited out, because it was pointless at that time. if I had to guess what the problem was, it was some sort of variable in the code that confused the compiler. maybe the compiler is the wrong version? however, that last thing in the dependencies only seems to exist with ubuntu 22.04, so it's probably not something to do with the linux distro.
Yeah, that's not what happened, because I end up with the same error on linux after messing with the export command. Guess I'll do some tinkering later because the PC build runs fine (see this)
Post automatically merged:

P.S.: But the windows one fails too :glare: It's the git now...
 
Can this actually fix my issue with switch building (I used make platfrom=switch before)?
this seems to use cmake, then make. I used the instructions in the building link. it links to another project, but the same steps work with yours as well. I don't really know what make PLATFORM=switch would do. some compiles require it if there's more than one possible platform it could build for.
 
this seems to use cmake, then make. I used the instructions in the building link. it links to another project, but the same steps work with yours as well. I don't really know what make PLATFORM=switch would do. some compiles require it if there's more than one possible platform it could build for.
Decided to switch (pun intended) to ye old windows and building w/o platform=switch still get these errors (1 and 2)
Post automatically merged:

$ make -j$(nproc)
linking nxray-16.elf
d:/apps/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/
ld.exe: required symbol `main' not defined
d:/apps/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/
ld.exe: D:/Apps/devkitPro/libnx/lib\libnx.a(switch_crt0.o): in function `_start':
/home/fincs/git/pacman-packages/libnx/src/libnx-4.2.2/nx/source/runtime/switch_crt0.s:70: undefined
reference to `main'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/libnx/switch_rules:80: /d/Programming/nxray-16/nxray-16.elf] Error 1
make: *** [Makefile:165: build] Error 2
Post automatically merged:

Building with cmake gives this error

CMake Error at CMakeLists.txt:241 (find_package):
By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SDL2", but
CMake did not find one.

Could not find a package configuration file provided by "SDL2" with any of
the following names:

SDL2Config.cmake
sdl2-config.cmake

Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
"SDL2_DIR" to a directory containing one of the above files. If "SDL2"
provides a separate development package or SDK, be sure it has been
installed.
 
Last edited by BurAndBY,
Decided to switch (pun intended) to ye old windows and building w/o platform=switch still get these errors (1 and 2)
Post automatically merged:

$ make -j$(nproc)
linking nxray-16.elf
d:/apps/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/
ld.exe: required symbol `main' not defined
d:/apps/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/12.2.0/../../../../aarch64-none-elf/bin/
ld.exe: D:/Apps/devkitPro/libnx/lib\libnx.a(switch_crt0.o): in function `_start':
/home/fincs/git/pacman-packages/libnx/src/libnx-4.2.2/nx/source/runtime/switch_crt0.s:70: undefined
reference to `main'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [/opt/devkitpro/libnx/switch_rules:80: /d/Programming/nxray-16/nxray-16.elf] Error 1
make: *** [Makefile:165: build] Error 2
Post automatically merged:

Building with cmake gives this error

CMake Error at CMakeLists.txt:241 (find_package):
By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "SDL2", but
CMake did not find one.

Could not find a package configuration file provided by "SDL2" with any of
the following names:

SDL2Config.cmake
sdl2-config.cmake

Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
"SDL2_DIR" to a directory containing one of the above files. If "SDL2"
provides a separate development package or SDK, be sure it has been
installed.
https://github.com/OpenXRay/xray-16/wiki/[EN]-How-to-build-and-setup-on-Linux
 

Site & Scene News

Popular threads in this forum