How To Setup Devkitpro/CTRULIB + Compiling on Windows?

Discussion in '3DS - Homebrew Development and Emulators' started by dpad_5678, Jan 12, 2016.

  1. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    Any tutorials?

    Where do I create my .cpp files so it will recognize the libraries and stuff like that?

    Do I have to do anything with my Environment Variables.


    Yes, I already installed devkitpro from the .exe setup file.
     
  2. ashinnblunts

    ashinnblunts GBAtemp Regular

    Member
    117
    120
    Jun 25, 2012
    United States
    Try compiling one of the examples in /devkitPro/examples/3ds/ by going to the directory in your command line and typing "make".

    To start your own project the easiest way is to just base it off of one of the examples or by copying the Makefile.
     
  3. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    Ok, thanks.

    So how would i modify the Makefile to compile a .cpp and not a .c file?
     
  4. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    762
    284
    Jul 28, 2008
    United States
    if you use the template project and makefile then it is setup to use a "source" and "include" directory. it can compile .c .cpp and .asm files that you put in the "source" directory.
     
  5. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    This is the error I get when I compile main.cpp .


    Code:
    C:\devkitPro\examples\3ds\templates\application>make
    make[1]: *** No rule to make target `c:/devkitPro/examples/3ds/templates/application/source/main.c', needed by `main.o'.  Stop.
    make: *** [build] Error 2
    
    C:\devkitPro\examples\3ds\templates\application></code>
     
  6. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    bump
     
  7. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    Please Help.
     
  8. wjchen

    wjchen Member

    Newcomer
    14
    9
    Jan 6, 2016
    Switzerland
    Use linux, or virtualbox.
     
  9. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    I'd rather not.

    All I want to do is compile C++/Cpp for 3DS.
     
  10. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    762
    284
    Jul 28, 2008
    United States
    Did you install devkitarm and ctrulib?
    Use msys (it is under devkitpro on the start menu) instead of the cmd.exe for the command line.
     
  11. dpad_5678
    OP

    dpad_5678 GBAtemp's Memelord

    Member
    1,410
    998
    Nov 19, 2015
    United States
    So msys is like a cmd alternative? I can run make from it?
     
  12. FenrirWolf

    FenrirWolf GBAtemp Psycho!

    Member
    4,347
    328
    Nov 19, 2008
    United States
    Sandy, UT
    Why not open it up, type the word 'make', and find out what happens?

    But the answer is yes.
     
    elhobbs likes this.
  13. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    762
    284
    Jul 28, 2008
    United States
    Yes. Paths are a little little different. The c:\ drive is mounted as /c/
    And use / instead of \