<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arefu</id>
	<title>3dbrew - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.3dbrew.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Arefu"/>
	<link rel="alternate" type="text/html" href="https://www.3dbrew.org/wiki/Special:Contributions/Arefu"/>
	<updated>2026-04-09T12:54:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=20192</id>
		<title>Setting up Development Environment</title>
		<link rel="alternate" type="text/html" href="https://www.3dbrew.org/w/index.php?title=Setting_up_Development_Environment&amp;diff=20192"/>
		<updated>2017-07-27T06:49:47Z</updated>

		<summary type="html">&lt;p&gt;Arefu: /* Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Setup =&lt;br /&gt;
* Install [http://devkitpro.org/ devkitARM]. If it&#039;s already installed, update it.&lt;br /&gt;
** On Windows, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ graphical installer].&lt;br /&gt;
** On Unix-like platforms such as Linux/macOS, there&#039;s a [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/devkitARMupdate.pl/download Perl script]. Make sure you also select libctru and the 3ds examples when installing.&lt;br /&gt;
* Depending on the kind of homebrew you want to develop, you may be interested in installing and using additional libraries and tools which don&#039;t ship alongside devkitARM/libctru. A list of them can be found in [[Homebrew Libraries and Tools]].&lt;br /&gt;
&lt;br /&gt;
==Windows==&lt;br /&gt;
devkitPro provides Win32-native precompiled versions of devkitARM which can be run directly on Windows.&lt;br /&gt;
* [http://sourceforge.net/projects/devkitpro/files/Automated%20Installer/ download the latest version of the graphical installer] from SourceForge and run it, following the instructions as you go.&lt;br /&gt;
* An Internet connection is required.&lt;br /&gt;
* 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.&lt;br /&gt;
* Once the installer has finished, launch MSYS from:&lt;br /&gt;
** Windows 7 and earlier: Start -&amp;gt; All Programs -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 8 and 8.1: Right click on the Start screen and select &#039;All Apps&#039;. You should find MSYS there.&lt;br /&gt;
** Windows 10 (pre-Anniversary Update): Start -&amp;gt; All Apps -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
** Windows 10 (post-Anniversary Update): Start -&amp;gt; devkitPro -&amp;gt; MSYS&lt;br /&gt;
&lt;br /&gt;
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&#039;s recommended that you stick to a more standard environment.&lt;br /&gt;
&lt;br /&gt;
If you do choose you use the WSL and you get the error:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
line *: syntax error near unexpected token `(&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
when running the command&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
source ~/.bashrc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
From what I understand it is because you&#039;re using a x64 bit of Windows and Bash doesn&#039;t understand what a &#039;(&#039; is, you can remedy this by opening the bashrc file in nano or if you want to be &amp;quot;Mr Gangster&amp;quot; you can use vi/vim however I RECOMMEND you use nano.&lt;br /&gt;
Once it&#039;s open navigate to to the line that has &amp;quot;export PATH=&amp;quot; look for all instances of things referencing files with &amp;quot;Program Files (x86)&amp;quot; in it, make sure the entries are still separated with a &amp;quot;:&amp;quot; though!&lt;br /&gt;
&lt;br /&gt;
==Unix-like platforms==&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
* First, you need to install curl so the installer can download the devkitARM packages, and you should also install Git - you&#039;ll need it to update libctru or share your code on GitHub, among many other things. If you are running Linux, you&#039;ll also need wget; it comes preinstalled on most distributions, but not all.&lt;br /&gt;
&lt;br /&gt;
* Find your way into a shell (eg. by opening a Terminal window), and follow the instructions for your OS:&lt;br /&gt;
** Debian/Ubuntu/Linux Mint/WSL: &amp;lt;code&amp;gt;sudo apt-get install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Fedora/CentOS/RHEL: &amp;lt;code&amp;gt;sudo yum install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** openSUSE: &amp;lt;code&amp;gt;sudo zypper install git curl&amp;lt;/code&amp;gt;&lt;br /&gt;
** Arch Linux: &amp;lt;code&amp;gt;sudo pacman -S git curl wget&amp;lt;/code&amp;gt;&lt;br /&gt;
** macOS: Download Git from [http://git-scm.com/download/mac] and install it. Curl is included with the OS.&lt;br /&gt;
&lt;br /&gt;
* Next, we need to download, make executable and run the devkitARM updater (don&#039;t worry, the updater is also the installer.)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
curl -L https://raw.githubusercontent.com/devkitPro/installer/master/perl/devkitARMupdate.pl -o devkitARMupdate.pl&lt;br /&gt;
chmod +x ./devkitARMupdate.pl&lt;br /&gt;
sudo ./devkitARMupdate.pl /opt/devkitpro&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Finally, we need to tell your shell where to find the devkitARM binaries.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;export DEVKITPRO=/opt/devkitpro&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export DEVKITARM=/opt/devkitpro/devkitARM&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
echo &amp;quot;export PATH=$PATH:/opt/devkitpro/devkitARM/bin&amp;quot; &amp;gt;&amp;gt; ~/.bashrc&lt;br /&gt;
source ~/.bashrc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Building the examples =&lt;br /&gt;
3DS examples are still being created; however, there are a growing number of examples available from the [https://github.com/devkitPro/3ds-examples devkitPro/3ds-examples GitHub repository].&lt;br /&gt;
There are now too many to list here in detail, so go ahead and browse them.&lt;br /&gt;
&lt;br /&gt;
* To download these, if you installed Git (as you will have if you followed the above instructions), simply type &amp;lt;code&amp;gt;git clone https://github.com/devkitPro/3ds-examples.git&amp;lt;/code&amp;gt; into your shell in the directory you wish to store the 3ds-examples folder in.&lt;br /&gt;
&lt;br /&gt;
These can be built from the command line.&lt;br /&gt;
&lt;br /&gt;
To start a new homebrew project from the &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; shell, simply type the following (replacing &amp;lt;code&amp;gt;&#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&amp;lt;/code&amp;gt; with the place you would like your project to be stored, with &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt; meaning your HOME directory):&lt;br /&gt;
 cp -r $DEVKITPRO/examples/3ds/templates/application &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
 cd &#039;&#039;&#039;~/projects/my3dsproject&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
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 &amp;lt;code&amp;gt;TARGET := $(notdir $(CURDIR))&amp;lt;/code&amp;gt; line in the Makefile to explicitly name your project.&lt;br /&gt;
&lt;br /&gt;
To compile it, type &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the project directory.&lt;br /&gt;
&lt;br /&gt;
==Running your code==&lt;br /&gt;
To run it on your 3DS, start the Homebrew Launcher, press Y to open the network loader, then on your PC type: &amp;lt;code&amp;gt;$DEVKITARM/bin/3dslink  &#039;&#039;&#039;my3dsproject&#039;&#039;&#039;.3dsx&amp;lt;/code&amp;gt;, replacing &#039;&#039;&#039;my3dsproject&#039;&#039;&#039; with the name of the 3dsx file you want to run.)&lt;br /&gt;
&lt;br /&gt;
If all goes well, you&#039;ll soon see your application running on your 3DS.&lt;br /&gt;
&lt;br /&gt;
==Building the examples on Linux with Netbeans==&lt;br /&gt;
* Go to File-&amp;gt;New Project...&lt;br /&gt;
* Select C/C++ Project with existing code&lt;br /&gt;
* Navigate to the examples directory and select the folder for the project you want to build; eg.    /home/vtsingaras/3ds/examples/app_launch&lt;br /&gt;
* Leave Configuration Mode to &#039;Automatic&#039; and click &#039;Finish&#039;.&lt;br /&gt;
* It will fail to build. Now edit Makefile and insert these two lines, adjusting for your devkitpro path, at the top:&lt;br /&gt;
&amp;lt;pre&amp;gt;export DEVKITPRO=/opt/devkitpro&lt;br /&gt;
export DEVKITARM=/opt/devkitpro/devkitARM&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Right-click the project and go to Properties-&amp;gt;Code Assistance and click C Compiler.&lt;br /&gt;
* In include directories enter &lt;br /&gt;
&amp;lt;pre&amp;gt;/opt/devkitpro/devkitARM/include;/opt/devkitpro/libctru/include&amp;lt;/pre&amp;gt;&lt;br /&gt;
adjusting again for your devkitPro path.&lt;br /&gt;
* Do the same for &#039;C++ Compiler&#039;.&lt;br /&gt;
* Go to &#039;Run&#039; and click &#039;Clean and Build Project&#039;.&lt;br /&gt;
* Now right-click on the project and select Code Assistance-&amp;gt;Reparse Project.&lt;br /&gt;
&lt;br /&gt;
Now you can use Netbeans&#039; code completion feature and build your project from the Run menu.&lt;br /&gt;
&lt;br /&gt;
= Building homebrew for distribution =&lt;br /&gt;
To build your homebrew, open a Bash shell as described above, browse to the folder of the homebrew you wish to compile, and run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* This will build a .elf file and a .3dsx file (the homebrew executable itself).&lt;br /&gt;
** The Homebrew Launcher can only run homebrew in the 3DSX format.&lt;br /&gt;
&lt;br /&gt;
* To build a CIA file, you need to use makerom on it along with a RSF file describing the application:&lt;br /&gt;
  makerom -f cia -o [.cia file] -rsf [RSF file] -target t -exefslogo -elf [ELF file] -icon [icon file] -banner [banner file]&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&#039;&#039;&#039;I get the &amp;quot;Please set DEVKITARM in your environment.&amp;quot; error.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Use the following command before installing [http://askubuntu.com/questions/573070/problem-setting-up-environment-for-make-command-execution]:&lt;br /&gt;
 sudo chown $USER /opt/devkitpro/ -R&lt;br /&gt;
 echo &amp;quot;export DEVKITPRO=\&amp;quot;/opt/devkitpro/\&amp;quot;&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 echo &amp;quot;export DEVKITARM=\&amp;quot;\${DEVKITPRO}/devkitARM/\&amp;quot;&amp;quot; &amp;gt;&amp;gt; ~/.profile&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Arefu</name></author>
	</entry>
</feed>