3ds.h: no such file or directory

Discussion in '3DS - Homebrew Development and Emulators' started by StackMasher, Nov 29, 2016.

  1. StackMasher
    OP

    StackMasher GBAtemp Regular

    Member
    118
    57
    Nov 29, 2016
    I'm trying to get into 3ds homebrew development but I'm facing a problem with this code:
    Code:
    #include <stdio.h>
    #include <3ds.h>
    
    int main()
    {
       //Initialise console
       gfxInitDefault();
       consoleInit(GFX_TOP,NULL);
    
       //Print hello world
       printf("Hello World!");
    
       //Main loop
       while (aptMainLoop())
       {
         gfxFlushBuffers();
         gfxSwapBuffers();
         gspWaitForVblank();
       }
    
       //Exit
       gfxExit();
       return 0;
    }
    Here's what bash looks like:
     
    Xenon Hacks likes this.
  2. metroid maniac

    metroid maniac An idiot with an opinion

    Member
    1,800
    719
    May 16, 2009
    Well, do you have 3ds.h? What's the output of ls?
     
  3. Xenon Hacks

    Xenon Hacks GBAtemp Guru

    Member
    7,115
    3,412
    Nov 13, 2014
    United States
    Always nice to see a new face and even though I can't help you welcome to GBAtemp :)
     
    StackMasher likes this.
  4. StackMasher
    OP

    StackMasher GBAtemp Regular

    Member
    118
    57
    Nov 29, 2016
    where's 3ds.h supposed to be?
     
  5. PabloMK7

    PabloMK7 Red Yoshi! ^ω^

    Member
    1,807
    1,113
    Feb 21, 2014
    Spain
    Yoshi's Island
    Did you add devkitarm to your environment variables?
     
  6. StackMasher
    OP

    StackMasher GBAtemp Regular

    Member
    118
    57
    Nov 29, 2016
    Sorry if I'm being a bit of an idiot, I'm just used to apt configuring libraries and putting everything in its place for me
     
  7. PabloMK7

    PabloMK7 Red Yoshi! ^ω^

    Member
    1,807
    1,113
    Feb 21, 2014
    Spain
    Yoshi's Island
    Did you restart your PC?
     
  8. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    807
    296
    Jul 28, 2008
    United States
  9. StackMasher
    OP

    StackMasher GBAtemp Regular

    Member
    118
    57
    Nov 29, 2016
    I used a perl script from the gbatemp wiki
    Ah and it looks like libctru is what I needed all along
    sigh I wish there was a proper tutorial for this stuff

    So devkitpro is a cross-compiler and C library port, and libctru provides useful functions like hidScanInput?
     
    Last edited by StackMasher, Nov 29, 2016
  10. Minnow

    Minnow GBAtemp Fan

    Member
    462
    710
    Oct 5, 2015
    Canada
    https://www.3dbrew.org/wiki/Setting_up_Development_Environment worked for me fine.
     
    gnmmarechal likes this.
  11. gnmmarechal

    gnmmarechal Kirigiri > Naoto

    Member
    GBAtemp Patron
    gnmmarechal is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,775
    2,908
    Jul 13, 2014
    Portugal
    https://gs2012.xyz
  12. Minnow

    Minnow GBAtemp Fan

    Member
    462
    710
    Oct 5, 2015
    Canada
    Yeah, that was the only "problem". Was able to easily fix by cloning the latest libctru and building it though.
     
  13. gnmmarechal

    gnmmarechal Kirigiri > Naoto

    Member
    GBAtemp Patron
    gnmmarechal is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,775
    2,908
    Jul 13, 2014
    Portugal
    https://gs2012.xyz
    I thought those examples used outdated stuff and don't build with a newer build of ctrulib?
     
  14. Minnow

    Minnow GBAtemp Fan

    Member
    462
    710
    Oct 5, 2015
    Canada
    HID worked for me. Haven't really tried any other ones, though.
     
  15. gnmmarechal

    gnmmarechal Kirigiri > Naoto

    Member
    GBAtemp Patron
    gnmmarechal is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,775
    2,908
    Jul 13, 2014
    Portugal
    https://gs2012.xyz
    Welp, not like it matters much I suppose.

    Sent from my cave of despair where I collect souls