Hi everyone,
I’m not a developer myself, but I’ve been experimenting with a small project together with ChatGPT, and I’d like to ask for some support from the community.
The idea is to create a Time Limiter overlay for the Nintendo Switch.
It’s somewhat inspired by NX Activity Log (which reads playtime data), but instead of focusing on logs and statistics, this project would allow:
I cannot get the project to compile properly.
My minimal program is
Typical errors I get are like:
It looks like my setup with libnx is incomplete, or I’m not compiling in the proper way
Could someone point me in the right direction for:
Thanks a lot
I’m not a developer myself, but I’ve been experimenting with a small project together with ChatGPT, and I’d like to ask for some support from the community.
The idea is to create a Time Limiter overlay for the Nintendo Switch.
It’s somewhat inspired by NX Activity Log (which reads playtime data), but instead of focusing on logs and statistics, this project would allow:
Read and display session time for the current title (like NX Activity Log does).
Adjust allowed playtime using button combinations (+10 min / -10 min).
Optional PIN protection so kids can’t just change the limit.
Per-game JSON storage with cumulative playtime.
Tesla overlay integration to make it accessible in-game.
- Installed Tesla Menu following this GitHub guide. = working
- Followed the official devkitPro setup guide.
- Installed libnx and tested with simple examples. => Not working
I cannot get the project to compile properly.
My minimal program is
main.cpp
#include <switch.h>
#include <string>
int main(int argc, char* argv[]) {
consoleInit(NULL);
// Hardcoded config (test version)
int limit = 60; // minutes
std::string pin = "1234"; // PIN code
u64 title_id = 0;
appletGetProgramId(&title_id);
// Main loop
while (appletMainLoop()) {
hidScanInput();
u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
if (kDown & KEY_PLUS) break; // exit with PLUS
consoleClear();
printf("Time Limiter Prototype (Test)\n");
printf("Title ID: %016lX\n", title_id);
printf("Limit: %d minutes\n", limit);
printf("PIN: %s\n", pin.c_str());
printf("\nPress + to quit.\n");
consoleUpdate(NULL);
}
consoleExit(NULL);
return 0;
}
Typical errors I get are like:
$ aarch64-none-elf-g++ -I/c/devkitPro/libnx/include -Iinclude -O2 -std=c++17 -L/c/devkitPro/libnx/lib source/main.cpp -specs /c/devkitPro/libnx/switch.specs -o build/time_limiter.nro
source/main.cpp: In function 'int main(int, char**)':
source/main.cpp:12:5: error: 'appletGetProgramId' was not declared in this scope; did you mean 'pmdmntGetProgramId'?
12 | appletGetProgramId(&title_id);
| ^~~~~~~~
| pmdmntGetProgramId
source/main.cpp:16:9: error: 'hidScanInput' was not declared in this scope
16 | hidScanInput();
| ^~~~~~
source/main.cpp:17:33: error: 'CONTROLLER_P1_AUTO' was not declared in this scope
17 | u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
| ^~~~~~~~
source/main.cpp:17:21: error: 'hidKeysDown' was not declared in this scope
17 | u64 kDown = hidKeysDown(CONTROLLER_P1_AUTO);
| ^~~~~
source/main.cpp:19:21: error: 'KEY_PLUS' was not declared in this scope
19 | if (kDown & KEY_PLUS) break; // exit with PLUS
It looks like my setup with libnx is incomplete, or I’m not compiling in the proper way
Could someone point me in the right direction for:
- the proper compilation workflow for my minimal example,
- I can share the complete code prototype if any developer is interested to help me to go on a real development on github for example
Thanks a lot

Last edited by dams31,










