Tutorial  Updated

Setting up Visual Studio 2017 environment for Nintendo Switch homebrew development

Hello everyone!

After a whole week fighting with SDL2 I decided to make a similar tutorial to my first one: https://gbatemp.net/threads/tutoria...for-nintendo-3ds-homebrew-development.461083/
so anyone can easily create stuff for Nintendo Switch.

This tutorial is mainly made for Windows, so there are maybe some things you cannot use on MAC/Linux. Just change those as needed.

There's a simple console tutorial made by @WerWolv, so be sure to check it out here.

Introduction:

This guide shows how to set up the initial Nintendo Switch homebrew development environment using Visual Studio 2017 Community Edition. This guide should also apply to Visual Studio 2017 Professional/Enterprise and up. The last version I tested is Visual Studio 2022 (16/02/2022 . This setup will allow you to use Visual Studio's IntelliSense when working with your code, while being able to compile your code into .NRO files for homebrew applications. We can create .NSP o our homebrews with NRO2NSPBuilder.

By following this guide, you will be creating your own project from scratch in C++. However, should you feel like using a pre-made Visual Studio project template, you may use devkitPro Examples or my own template. If you want a game as reference, check any of my games: Good examples are T-REKT NX or TIL NX which has drag functions.

We will call Visual Studio 2017 Community as "VS2017" from here on out. As I mentioned before, Enterprise and Professional editions can be used as well.

Microsoft Visual C/C++ is not bundled with VS2017 by default. You must choose to install this package, as it is required for Nintendo Switch homebrew development. If you cannot find it in the VS2017 Installer, you can follow the instructions to obtain this package below.

Minum Requirements:

- Latest version of Visual Studio 2017 Community: https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
- Microsoft Visual C/C++ package for Visual Studio 2017 Community.
- Latest stable version of devkitPro: http://devkitpro.org/wiki/Getting_Started
- Switch packages obtained by pacman packages
- Knowledge in C or C++.
- Creativity and time to make good stuff.

Notes:

To explain the inconsistencies of slashes, "\" and "/", used in this guide:

In Windows, of any editions, it uses backslashes "\" as file separators, and not forward slashes "/". This also means in Visual Studio of any editions, it natively uses backslashes "\" as file separators. If you see forward slashes "/", this clearly means it is used in Makefiles.

The usage of backslashes "\" was due to the forward slashes "/" being used as indicators for "switches" or "flags" (cmd.exe /w, or /help) in IBM software, and is not compatible to parse as file separators. MS-DOS adopted this, and to this day, forward slash switches are still used in many places.

Setup:

1) Acquiring Microsoft Visual C/C++ for VS2017:

- Install VS2017. It will install Visual Studio Installer too.

- Run Visual Studio Installer.

- Click on Modify below VS2017.

- Click on Components > Select C++ components > Install.


VS2017 will then install Visual C/C++ packages. Follow the instructions, then continue to the next section.


2) Nintendo Switch Homebrew Development Setup:

-
Install devkitPro, by following the instructions given in the Getting Started article.

- Run Visual Studio 2017 Community.

- On the Start page in VS2017, under the Start section, click "New Project...".

- When in the New Project wizard, click on Installed > Templates > Visual C++ > Makefile Project. It can be in Installed > C++ > MAKE.

- Down at the bottom, choose your project name, your solution location, and the solution action.

NOTE: MAKE SURE your solution location is located in a directory where the file path does NOT contain any WHITESPACES!

- Click OK.

- A new panel will show. Add the commands for Build, Rebuild, and Clean, as follows:

Build-> make
Rebuild-> make clean all
Clean-> make clean


- On the right pane, add the following path to the "Include Search Path":


\path\to\devkitPro\devkitA64\include
\path\to\devkitPro\libnx\include
$(ProjectDir)\include

- Click OK and the project will be setup.


If you want to add more folders to include:

- In the Solution Explorer, right click on your project, and choose Properties.

- On the left pane, click on General.

- Make sure under General, Configuration Type is set to Makefile.

- On the left pane, click on VC++ Directories.

- Under General, click on Include Directories, click on the arrow dropdown button on the right, and select <Edit>.

- Add the desired filepaths.

- Click OK to go back to the VS2017 editor.



- In the Solution Explorer, add a new item under the filter, "Source Files", by right clicking the filter, Add > "New Item...".

- In the Add New Item wizard, click on C++ File.

- Down at the bottom of the wizard, make sure the Location is the following, with the folder, "source" added at the end (And yes, it is all lowercase "source"):

\path\without\whitespace\to\project\source\

- Type your C++ file name (lets call it main.cpp), and click on "Add".
Add the following #if and #defines macros at the top of your CPP file:

Code:
#if __INTELLISENSE__
 typedef unsigned int __SIZE_TYPE__;
 typedef unsigned long __PTRDIFF_TYPE__;
 #define __attribute__(q)
 #define __builtin_strcmp(a,b) 0
 #define __builtin_strlen(a) 0
 #define __builtin_memcpy(a,b) 0
 #define __builtin_va_list void*
 #define __builtin_va_start(a,b)
 #define __extension__
 #endif

 #if defined(_MSC_VER)
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;
 #endif

Then add the following code to your C++ file after it:

Code:
#include <switch.h>
#include <iostream>

int main(int argc, char* argv[])
{
    consoleInit(NULL);

    // Other initialization goes here. As a demonstration, we print hello world.
    std::cout<<"Hello World!\n"<<std::endl;

    // Configure our supported input layout: a single player with standard controller styles
    padConfigureInput(1, HidNpadStyleSet_NpadStandard);

    // Initialize the default gamepad (which reads handheld mode inputs as well as the first connected controller)
    PadState pad;
    padInitializeDefault(&pad);

    // Main loop
    while (appletMainLoop())
    {
        // Scan all the inputs. This should be done once for each frame
        padUpdate(&pad);

        // hidKeysDown returns information about which buttons have been
        // just pressed in this frame compared to the previous one
        u64 kDown = padGetButtonsDown(&pad);

    if (kDown & HidNpadButton_A)
              std::cout<<"Pressed A button!\n"<<std::endl;

        if (kDown & HidNpadButton_Plus)
            break; // break in order to return to hbmenu

        // Your code goes here

        // Update the console, sending a new frame to the display
        consoleUpdate(NULL);
    }

    // Deinitialize and clean up resources used by the console (important!)
    consoleExit(NULL);
    return 0;
}

This is the part where it gets tricky.

Ignore the errors in the Error List by turning it off or clicking "X of X Errors" once, where X is any given number.

If you see any squiggly lines underneath ANY letter or character in the code provide above, it means you have set your IntelliSense incorrectly. Make sure to double check all of the steps above, to see if you have missed any.


Tricky part is finished. Congratulations!

-
In File Explorer, navigate to the following directory:

\path\to\devkitPro\examples\switch\templates\application

- Copy the Makefile file.

- In File Explorer, navigate back to your project root directory.

- Paste the Makefile file to the project root directory.

- In VS2017, in the Solution Explorer, right click on your project, Add > "Existing Item...".

- Select Makefile.

- Click on "Add".

- In the Solution Explorer, open the Makefile, so the file is opened in VS2017.

- Edit the name of the homebrew, the creator to fit your project.

- Save Makefile.

- In the Solution Explorer, right click on the Makefile, and select "Properties".

- In the Makefile Property Pages, make sure on the right pane, under General, the Item Type is Text, and the rest of the entries are empty.

- Click OK to exit back to VS2017 editor.

- Hit CTRL+SHIFT+B or in the taskbar, "Build > Build Solution" or "Build > Build [project name]", where [project name] is your project name. You can also click on the green button: Windows Debugger and it will compile too.

- In VS2017, in the Output tab, you should see your code being built via Makefile.

And that's it! From this point on, you are free to add anything you want.

Adding more packages for devkitPro:

We will use some libraries in our homebrews but for sure, we need SDL2. Let's install it!

- First we need to open the command window: Windows + R > cmd or Shift + Right Click > Open CMD Prompt Here

- For displaying the package list (to know package names), just type: pacman -Sl

-
Install the packages with: pacman -Syuu [package1] [package2] [every package you want to install...]

Example: pacman -Syuu switch-sdl switch-sdl2_gfx switch-sdl2_image switch-sdl2_ttf switch-sdl2_net switch-sdl2_mixer

You may need to update portlibs by:

pacman -S switch-portlibs

NOTE: You can install as many packages as you need in your homebrew

-
Once the packages are installed, to use SDL we need to add to the makefile this line:
Code:
LIBS    :=    -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lnx

and if you want to use every library as the template (you need every package installed):

Code:
LIBS    :=    -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2_mixer -lpng -ljpeg -lglad -lEGL -lglapi -ldrm_nouveau -lvorbisidec -logg -lmpg123 -lmodplug -lstdc++ -lavformat -lavcodec -lswresample -lswscale -lavutil -lbz2 -lass -ltheora -lvorbis -lopus `sdl2-config --libs` `freetype-config --libs` -lnx

Using SDL in your project:

We will use NX-Shell's my SDL Helper modification. Let's see how it works:

First, we will download SDL_Helper.hpp, SDL_Helper.cpp, FontCache.c and FontCache.h from my template and place it in our source folder.

Now you can use SDL2. Congrats!

I recommend you to create an SDL_Helper object and send it's pointers.

For that, in the main.cpp copy this at the beggining of the method:

Code:
    plInitialize();
    romfsInit();
    SDL_Helper * helper = new SDL_Helper();
    helper->SDL_HelperInit();

For loading an image we will use:

Code:
SDL_Texture * myTexture;
helper->SDL_LoadImage(&myTexture, "romfs:/textureSprite.png");

in the main loop, when you need to paint your texture just use:

Code:
        helper->SDL_DrawImage(myTexture, x, y);
        helper->SDL_Renderdisplay();

I added rect method for multiple frames:

Code:
        helper->SDL_DrawImageRect(myTexture, x, y, xOffset, yOffset, frameWidth, frameHeight);
        helper->SDL_Renderdisplay();

And opacity methods:

Code:
        helper->SDL_DrawImageOpacity(myTexture, x, y, opacity);
        helper->SDL_Renderdisplay();

Once we exit the program, we need to delete everything:

Code:
    plExit();
    romfsExit();
    helper->SDL_Exit();
    delete(helper);

Testing the homebrew:

YuZu now supports SDL Rendering in latest Canary:

https://github.com/yuzu-emu/yuzu-canary/releases

For testing in Real-Hardware we have two options:

- Copy the generated .nro to the SD/switch folder and test it from the HBMenu.
- Use NX Link:

NXLink is already installed with devkitpro if Switch tools are installed. If you don't have it, install switch tools with pacman.

- Go to the HBMenu in your switch and press Y to start the netloader. A pop-up will appear with the IP of your switch (It must be connected to Internet).

(You can do the commands directly in Windows CMD, but this is more comfy)

- Go back to your computer and create a text file with this commands:

Code:
cd path\to\devkitPro\tools\bin
nxlink -s -a 192.xxx.xxx.xxx path\to\homebrew.nro

Where the numbers are the IP shown in your switch's screen

Save the text file with .bat extension.

Just double click on the bat and it will start sending the HB to your switch. After the copy, the homebrew will run automatically.

Template:

In the template you will find a good example of how to create a game easily with template classes: Splash Screen, Title Screen, Intro Screen (cinematic) and Game Screen.

It has some UI classes for creating sprites, buttons and toggles. Sprites can be animated by frames. Sprites can be draggable with the Switch touch screen.

It has game data and multilanguage support with JSON.

Take a look to it, and if you need help, just ask.

Credits:

SDL2 references:

  • joel16
  • bernardo giordano
  • Cheeze
Help and simple tutorial:
  • Cid2mizard
  • WerWolv
General:
  • Credits for everyone involved in LibNX and Homebrew Development
  • Thanks, SciresM for your awesome work in Atmosphere CFW.
  • Smealum, because you deserve it, dude.

If this tutorial has been useful to you, credits are appreaciated. :D
For anything, just leave a comment below.
 
Last edited by Manurocker95,

Gigaboy

Active Member
Newcomer
Joined
May 12, 2019
Messages
31
Trophies
0
Age
22
Website
www.gigaboy.dev
XP
205
Country
United States
I don't know what you mean by ProjectDir where do you find that.
It's the directory where you create your Visual Studio project. If I created my project in my documents folder, then $(projectdir) would be C:\Users\imado\Documents\MyProject. $(projectdir)\include simply means the location of your project, then the directory inside labeled "include".
 

mo_v

Member
Newcomer
Joined
May 9, 2019
Messages
21
Trophies
0
Age
22
XP
129
Country
United States
$(ProjectDir) is the macro of the path to your project directory. $(ProjectDir)\include = path\to\your\Visual-Studio-Project-directory\include
Sorry to be a bother, but I dont see an include folder in my project directory. Edit: There is only squiggly lines under #include and SSIZET.
 
Last edited by mo_v,

Shadd

Well-Known Member
Member
Joined
Jan 27, 2016
Messages
301
Trophies
0
Location
Jeff The Killer's Bathroom
XP
473
Country
United States
Hello everyone!

After a whole week fighting with SDL2 I decided to make a similar tutorial to my first one: https://gbatemp.net/threads/tutoria...for-nintendo-3ds-homebrew-development.461083/
so anyone can easily create stuff for Nintendo Switch.

This tutorial is mainly made for Windows, so there are maybe some things you cannot use on MAC/Linux. Just change those as needed.

There's a simple console tutorial made by @WerWolv, so be sure to check it out here.

Introduction:

This guide shows how to set up the initial Nintendo Switch homebrew development environment using Visual Studio 2017 Community Edition. This guide should also apply to Visual Studio 2017 Professional/Enterprise and up. This setup will allow you to use Visual Studio's IntelliSense when working with your code, while being able to compile your code into .NRO files for homebrew applications. We can create .NSP o our homebrews with NRO2NSPBuilder.

By following this guide, you will be creating your own project from scratch in C++. However, should you feel like using a pre-made Visual Studio project template, you may use devkitPro Examples or my own template. If you want a game as reference, check any of my games: Good examples are T-REKT NX or TIL NX which has drag functions.

We will call Visual Studio 2017 Community as "VS2017" from here on out. As I mentioned before, Enterprise and Professional editions can be used as well.

Microsoft Visual C/C++ is not bundled with VS2017 by default. You must choose to install this package, as it is required for Nintendo Switch homebrew development. If you cannot find it in the VS2017 Installer, you can follow the instructions to obtain this package below.

Minum Requirements:

- Latest version of Visual Studio 2017 Community: https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
- Microsoft Visual C/C++ package for Visual Studio 2017 Community.
- Latest stable version of devkitPro: http://devkitpro.org/wiki/Getting_Started
- Switch packages obtained by pacman packages
- Knowledge in C or C++.
- Creativity and time to make good stuff.

Notes:

To explain the inconsistencies of slashes, "\" and "/", used in this guide:

In Windows, of any editions, it uses backslashes "\" as file separators, and not forward slashes "/". This also means in Visual Studio of any editions, it natively uses backslashes "\" as file separators. If you see forward slashes "/", this clearly means it is used in Makefiles.

The usage of backslashes "\" was due to the forward slashes "/" being used as indicators for "switches" or "flags" (cmd.exe /w, or /help) in IBM software, and is not compatible to parse as file separators. MS-DOS adopted this, and to this day, forward slash switches are still used in many places.

Setup:

1) Acquiring Microsoft Visual C/C++ for VS2017:

- Install VS2017. It will install Visual Studio Installer too.

- Run Visual Studio Installer.

- Click on Modify below VS2017.

- Click on Components > Select C++ components > Install.


VS2017 will then install Visual C/C++ packages. Follow the instructions, then continue to the next section.


2) Nintendo Switch Homebrew Development Setup:


- Install devkitPro, by following the instructions given in the Getting Started article.

- Run Visual Studio 2017 Community.

- On the Start page in VS2017, under the Start section, click "New Project...".

- When in the New Project wizard, click on Installed > Templates > Visual C++ > Makefile Project. It can be in Installed > C++ > MAKE.

- Down at the bottom, choose your project name, your solution location, and the solution action.

NOTE: MAKE SURE your solution location is located in a directory where the file path does NOT contain any WHITESPACES!


- Click OK.

- A new panel will show. Add the commands for Build, Rebuild, and Clean, as follows:

Build-> make
Rebuild-> make clean all
Clean-> make clean


- On the right pane, add the following path to the "Include Search Path":


\path\to\devkitPro\devkitA64\include
\path\to\devkitPro\libnx\include
$(ProjectDir)\include

- Click OK and the project will be setup.


If you want to add more folders to include:

- In the Solution Explorer, right click on your project, and choose Properties.

- On the left pane, click on General.

- Make sure under General, Configuration Type is set to Makefile.

- On the left pane, click on VC++ Directories.

- Under General, click on Include Directories, click on the arrow dropdown button on the right, and select <Edit>.

- Add the desired filepaths.

- Click OK to go back to the VS2017 editor.



- In the Solution Explorer, add a new item under the filter, "Source Files", by right clicking the filter, Add > "New Item...".

- In the Add New Item wizard, click on C++ File.

- Down at the bottom of the wizard, make sure the Location is the following, with the folder, "source" added at the end (And yes, it is all lowercase "source"):

\path\without\whitespace\to\project\source\

- Type your C++ file name (lets call it main.cpp), and click on "Add".
Add the following #if and #defines macros at the top of your CPP file:

Code:
#if __INTELLISENSE__
 typedef unsigned int __SIZE_TYPE__;
 typedef unsigned long __PTRDIFF_TYPE__;
 #define __attribute__(q)
 #define __builtin_strcmp(a,b) 0
 #define __builtin_strlen(a) 0
 #define __builtin_memcpy(a,b) 0
 #define __builtin_va_list void*
 #define __builtin_va_start(a,b)
 #define __extension__
 #endif

 #if defined(_MSC_VER)
 #include <BaseTsd.h>
 typedef SSIZE_T ssize_t;
 #endif

Then add the following code to your C++ file after it:

Code:
#include <switch.h>
#include <iostream>

int main(int argc, char* argv[])
{
    consoleInit(NULL);

    // Other initialization goes here. As a demonstration, we print hello world.
    std::cout<<"Hello World!\n"<<std::endl;

    // Main loop
    while (appletMainLoop())
    {
        // Scan all the inputs. This should be done once for each frame
        hidScanInput();

        // hidKeysDown returns information about which buttons have been
        // just pressed in this frame compared to the previous one
        u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);

    if (kDown & KEY_A)
              std::cout<<"Pressed A button!\n"<<std::endl;

        if (kDown & KEY_PLUS)
            break; // break in order to return to hbmenu

        // Your code goes here

        // Update the console, sending a new frame to the display
        consoleUpdate(NULL);
    }

    // Deinitialize and clean up resources used by the console (important!)
    consoleExit(NULL);
    return 0;
}

This is the part where it gets tricky.

Ignore the errors in the Error List by turning it off or clicking "X of X Errors" once, where X is any given number.

If you see any squiggly lines underneath ANY letter or character in the code provide above, it means you have set your IntelliSense incorrectly. Make sure to double check all of the steps above, to see if you have missed any.


Tricky part is finished. Congratulations!

- In File Explorer, navigate to the following directory:

\path\to\devkitPro\examples\switch\templates\application

- Copy the Makefile file.

- In File Explorer, navigate back to your project root directory.

- Paste the Makefile file to the project root directory.

- In VS2017, in the Solution Explorer, right click on your project, Add > "Existing Item...".

- Select Makefile.

- Click on "Add".

- In the Solution Explorer, open the Makefile, so the file is opened in VS2017.

- Edit the name of the homebrew, the creator to fit your project.

- Save Makefile.

- In the Solution Explorer, right click on the Makefile, and select "Properties".

- In the Makefile Property Pages, make sure on the right pane, under General, the Item Type is Text, and the rest of the entries are empty.

- Click OK to exit back to VS2017 editor.

- Hit CTRL+SHIFT+B or in the taskbar, "Build > Build Solution" or "Build > Build [project name]", where [project name] is your project name. You can also click on the green button: Windows Debugger and it will compile too.

- In VS2017, in the Output tab, you should see your code being built via Makefile.

And that's it! From this point on, you are free to add anything you want.

Adding more packages for devkitPro:

We will use some libraries in our homebrews but for sure, we need SDL2. Let's install it!

- First we need to open the command window: Windows + R > cmd or Shift + Right Click > Open CMD Prompt Here

- For displaying the package list (to know package names), just type: pacman -Sl

-
Install the packages with: pacman -Syuu [package1] [package2] [every package you want to install...]

Example: pacman -Syuu switch-sdl switch-sdl2_gfx switch-sdl2_image switch-sdl2_ttf switch-sdl2_net switch-sdl2_mixer


NOTE: You can install as many packages as you need in your homebrew


-
Once the packages are installed, to use SDL we need to add to the makefile this line:
Code:
LIBS    :=    -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lnx

and if you want to use every library as the template (you need every package installed):

Code:
LIBS    :=    -lSDL2_ttf -lSDL2_gfx -lSDL2_image -lSDL2_mixer -lpng -ljpeg -lglad -lEGL -lglapi -ldrm_nouveau -lvorbisidec -logg -lmpg123 -lmodplug -lstdc++ -lavformat -lavcodec -lswresample -lswscale -lavutil -lbz2 -lass -ltheora -lvorbis -lopus `sdl2-config --libs` `freetype-config --libs` -lnx

Using SDL in your project:

We will use NX-Shell's my SDL Helper modification. Let's see how it works:

First, we will download SDL_Helper.hpp, SDL_Helper.cpp, FontCache.c and FontCache.h from my template and place it in our source folder.

Now you can use SDL2. Congrats!

I recommend you to create an SDL_Helper object and send it's pointers.

For that, in the main.cpp copy this at the beggining of the method:

Code:
    plInitialize();
    romfsInit();
    SDL_Helper * helper = new SDL_Helper();
    helper->SDL_HelperInit();

For loading an image we will use:

Code:
SDL_Texture * myTexture;
helper->SDL_LoadImage(&myTexture, "romfs:/textureSprite.png");

in the main loop, when you need to paint your texture just use:

Code:
        helper->SDL_DrawImage(myTexture, x, y);
        helper->SDL_Renderdisplay();

I added rect method for multiple frames:

Code:
        helper->SDL_DrawImageRect(myTexture, x, y, xOffset, yOffset, frameWidth, frameHeight);
        helper->SDL_Renderdisplay();

And opacity methods:

Code:
        helper->SDL_DrawImageOpacity(myTexture, x, y, opacity);
        helper->SDL_Renderdisplay();

Once we exit the program, we need to delete everything:

Code:
    plExit();
    romfsExit();
    helper->SDL_Exit();
    delete(helper);

Testing the homebrew:

YuZu now supports SDL Rendering in latest Canary:

https://github.com/yuzu-emu/yuzu-canary/releases

For testing in Real-Hardware we have two options:

- Copy the generated .nro to the SD/switch folder and test it from the HBMenu.
- Use NX Link:

NXLink is already installed with devkitpro if Switch tools are installed. If you don't have it, install switch tools with pacman.

- Go to the HBMenu in your switch and press Y to start the netloader. A pop-up will appear with the IP of your switch (It must be connected to Internet).

(You can do the commands directly in Windows CMD, but this is more comfy)

- Go back to your computer and create a text file with this commands:

Code:
cd path\to\devkitPro\tools\bin
nxlink -s -a 192.xxx.xxx.xxx path\to\homebrew.nro

Where the numbers are the IP shown in your switch's screen

Save the text file with .bat extension.

Just double click on the bat and it will start sending the HB to your switch. After the copy, the homebrew will run automatically.

Template:

In the template you will find a good example of how to create a game easily with template classes: Splash Screen, Title Screen, Intro Screen (cinematic) and Game Screen.

It has some UI classes for creating sprites, buttons and toggles. Sprites can be animated by frames. Sprites can be draggable with the Switch touch screen.

It has game data and multilanguage support with JSON.

Take a look to it, and if you need help, just ask.

Credits:

SDL2 references:

  • joel16
  • bernardo giordano
  • Cheeze
Help and simple tutorial:
  • Cid2mizard
  • WerWolv
General:
  • Credits for everyone involved in LibNX and Homebrew Development
  • Thanks, SciresM for your awesome work in Atmosphere CFW.
  • Smealum, because you deserve it, dude.

If this tutorial has been useful to you, credits are appreaciated. :D
For anything, just leave a comment below.
This was a fantastic tutorial! But I am still having an issue when including my file headers and cpp files. It seems to always error out when trying to include my own .cpp and .h/.hpp headers. Is there a solution around this?
 

Manurocker95

Game Developer & Pokémon Master
OP
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
28
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,769
Country
Spain
This was a fantastic tutorial! But I am still having an issue when including my file headers and cpp files. It seems to always error out when trying to include my own .cpp and .h/.hpp headers. Is there a solution around this?
Weird, do you have the makefile correcly setup? (There you select your source code folder)
 

Zer0Risk

Member
Newcomer
Joined
Jun 28, 2020
Messages
5
Trophies
0
Age
22
XP
34
Country
Germany
Ty for the tutorial. For me the makefile doenst compile in VS but on cmd with msys2 "make" it worked. My Problem is, I can't call the plInitialize() function from pl.h, a PlServiceType is required as argument :O ?? Could someone explain me what to do now xD. Thx in advance.
 
Last edited by Zer0Risk,

Manurocker95

Game Developer & Pokémon Master
OP
Member
Joined
May 29, 2016
Messages
1,511
Trophies
0
Age
28
Location
Madrid
Website
manuelrodriguezmatesanz.com
XP
2,769
Country
Spain
Ty for the tutorial. For me the makefile doenst compile in VS but on cmd with msys2 "make" it worked. My Problem is, I can't call the plInitialize() function from pl.h, a PlServiceType is required as argument :O ?? Could someone explain me what to do now xD. Thx in advance.
Do you have devkitpro installed with all environment variables setup?
 

Zer0Risk

Member
Newcomer
Joined
Jun 28, 2020
Messages
5
Trophies
0
Age
22
XP
34
Country
Germany
Do you have devkitpro installed with all environment variables setup?
I guess. I got DEVKITA64 and DEVKITPRO correctly setup, the rest (*ARM and *PPC) has no directory nor files.
 

Attachments

  • env.png
    env.png
    3.9 KB · Views: 265

scandal_uk

Not Really There
Member
Joined
Oct 3, 2005
Messages
322
Trophies
0
Location
UK
XP
580
Country
United Kingdom
How difficult can it be? You can even setup VS Code to compile Switch code in L4T, granted it’ll take 2 hours to build devkit but it’s all so easy on any platform I don’t understand how people get stuck!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Veho @ Veho: Mkay.