Setting up Development Environment: Difference between revisions
Readding useful help that was removed for no real reason. Undo revision 18882 by WinterMute (talk) |
WinterMute (talk | contribs) Update to reflect current use & clarify some aspects. Users should not be overwriting things in the devkitPro folder directly this will lead to problems in the future. |
||
Line 16: | Line 16: | ||
** Windows 10 (post-Anniversary Update): Start -> devkitPro -> MSYS | ** Windows 10 (post-Anniversary Update): Start -> devkitPro -> MSYS | ||
Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. | Alternatively starting with Windows 10 Anniversary Update (Version 1607), the [https://msdn.microsoft.com/en-us/commandline/wsl/install_guide Windows Subsystem for Linux (WSL)] may also be used to run the Linux version of devkitARM. Unless you have some particular need for WSL it's recommended that you stick to a more standard environment. | ||
==Unix-like platforms== | ==Unix-like platforms== | ||
Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86/x64), macOS (universal binary). Note that Linux x64 binaries are usable under WSL. | Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86/x64), macOS (universal binary). Note that Linux x64 binaries are usable under WSL. | ||
* First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you'll need it to update | * First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you'll need it to update libctru or share your code on GitHub, among many other things. | ||
* Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS: | * Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS: | ||
Line 49: | Line 49: | ||
* To download these, if you installed Git (as you will have if you followed the above instructions), simply type <code>git clone https://github.com/devkitPro/3ds-examples.git</code> into your shell in the directory you wish to store the 3ds-examples folder in. | * To download these, if you installed Git (as you will have if you followed the above instructions), simply type <code>git clone https://github.com/devkitPro/3ds-examples.git</code> into your shell in the directory you wish to store the 3ds-examples folder in. | ||
These can be built from the command line. | These can be built from the command line. | ||
Line 56: | Line 55: | ||
cp -r $DEVKITPRO/examples/3ds/templates/application '''~/projects/my3dsproject''' | cp -r $DEVKITPRO/examples/3ds/templates/application '''~/projects/my3dsproject''' | ||
cd '''~/projects/my3dsproject''' | cd '''~/projects/my3dsproject''' | ||
The standard Makefile will use the folder as the name of the 3dsx that will be built. You can keep that behaviour or simply change the <code>TARGET := $(notdir $(CURDIR))</code> line in the Makefile to explicitly name your project. | |||
To compile it, type <code>make</code> in the project directory. | To compile it, type <code>make</code> in the project directory. | ||
To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: <code>$DEVKITARM/bin/3dslink | To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: <code>$DEVKITARM/bin/3dslink '''my3dsproject'''.3dsx</code>, replacing '''my3dsproject''' with the name of the 3dsx file you want to run.) | ||
</code>. | |||
If all goes well, you'll soon see your application running on your 3DS. | If all goes well, you'll soon see your application running on your 3DS. | ||
Line 73: | Line 74: | ||
* Right-click the project and go to Properties->Code Assistance and click C Compiler. | * Right-click the project and go to Properties->Code Assistance and click C Compiler. | ||
* In include directories enter | * In include directories enter | ||
<pre>/opt/devkitpro/devkitARM/include;/opt/devkitpro | <pre>/opt/devkitpro/devkitARM/include;/opt/devkitpro/libctru/include</pre> | ||
adjusting again for your devkitPro path. | adjusting again for your devkitPro path. | ||
* Do the same for 'C++ Compiler'. | * Do the same for 'C++ Compiler'. | ||
Line 86: | Line 87: | ||
* This will build a .elf file and a .3dsx file (the homebrew executable itself) together with a .smdh file (the icon). | * This will build a .elf file and a .3dsx file (the homebrew executable itself) together with a .smdh file (the icon). | ||
** The Homebrew Launcher can only run homebrew in the 3DSX format, and can only display SMDH icons. | ** The Homebrew Launcher can only run homebrew in the 3DSX format, and can only display SMDH icons. | ||
= Troubleshooting = | = Troubleshooting = | ||
Line 99: | Line 96: | ||
echo "export DEVKITARM="/opt/devkitpro/devkitARM/" >> ~/.profile | echo "export DEVKITARM="/opt/devkitpro/devkitARM/" >> ~/.profile | ||
source ~/.profile | source ~/.profile | ||
For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state. | For WSL users, you need to close the Bash shell, then reopen it for WSL to reload all of the variables from a clean state. | ||