Setting up Development Environment: Difference between revisions
Stop trying to cause edit wars. Thanks. There is a reason for this to be here, even if you do not like it. |
WinterMute (talk | contribs) No edit summary |
||
(20 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
= Setup = | = Setup = | ||
* Install [ | * Install [https://devkitpro.org/ devkitARM]. If it's already installed, update it. | ||
** On Windows, there's a [ | ** On Windows, there's a [https://github.com/devkitPro/installer/releases/latest graphical installer]. | ||
** On Unix-like platforms such as Linux/macOS, there's a [ | ** On Unix-like platforms such as Linux/macOS, there's a [https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl Perl script]. Make sure you also select libctru and the 3ds examples when installing. | ||
* Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don't ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]]. | * Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don't ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]]. | ||
==Windows== | ==Windows== | ||
devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows. | devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows. | ||
* [ | * [https://github.com/devkitPro/installer/releases/latest download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go. | ||
* An Internet connection is required. | * An Internet connection is required. | ||
* You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish. | * You will want to make sure devkitARM is selected during the installation process to develop for the 3DS (and also the DS and GBA) - you can also install devkitPPC (for GameCube/Wii development) and devkitPSP (for PlayStation Portable development) if you wish. | ||
Line 19: | Line 19: | ||
==Unix-like platforms== | ==Unix-like platforms== | ||
Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux ( | Currently devkitPro provides precompiled versions of devkitARM for the following Unix-like platforms: Linux (x86_64), macOS (x86_64). Note that Linux x86_64 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 libctru or share your code on GitHub, among many other things. | * 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. If you are running Linux, you'll also need wget; it comes preinstalled on most distributions, but not all. | ||
* 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: | ||
** Debian/Ubuntu/Linux Mint/WSL: <code>sudo apt-get install git curl</code> | ** Debian/Ubuntu/Linux Mint/Ubuntu on WSL: <code>sudo apt-get install git curl</code> | ||
** Fedora/CentOS/RHEL: <code>sudo yum install git curl</code> | ** Fedora/CentOS/RHEL: <code>sudo yum install git curl</code> | ||
** openSUSE: <code>sudo zypper install git curl</code> | ** openSUSE: <code>sudo zypper install git curl</code> | ||
** Arch Linux/ALWSL: <code>sudo pacman -S git curl wget</code> | |||
** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS. | ** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS. | ||
Line 33: | Line 34: | ||
curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl | curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl | ||
chmod +x ./devkitARMupdate.pl | chmod +x ./devkitARMupdate.pl | ||
./devkitARMupdate.pl | |||
</pre> | </pre> | ||
You can either use sudo here or chown /opt/devkitpro to be writable by your user before running the script. | |||
= Building the examples = | = Building the examples = | ||
Line 59: | Line 54: | ||
To compile it, type <code>make</code> in the project directory. | To compile it, type <code>make</code> in the project directory. | ||
==Running your code== | |||
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.) | 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.) | ||
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 81: | Line 77: | ||
Now you can use Netbeans' code completion feature and build your project from the Run menu. | Now you can use Netbeans' code completion feature and build your project from the Run menu. | ||
= Troubleshooting = | = Troubleshooting = | ||
Line 97: | Line 83: | ||
Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]: | Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]: | ||
sudo chown $USER /opt/devkitpro/ -R | sudo chown $USER /opt/devkitpro/ -R | ||
echo "export DEVKITPRO="/opt/devkitpro/" >> ~/.profile | echo "export DEVKITPRO=\"/opt/devkitpro/\"" >> ~/.profile | ||
echo "export DEVKITARM=" | echo "export DEVKITARM=\"\${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. |