How to install Ctrulib? (Linux)

Discussion in '3DS - Homebrew Development and Emulators' started by Monado_III, May 15, 2015.

  1. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    So I've done this tutorial http://devkitpro.org/wiki/Getting_Started/devkitARM (including the last line at the bottom) and followed the README.md that comes with Ctrulib but still, whenever I try to compile one of the ctrulib examples it still gives me an error ( fatal error: 3ds.h: No such file or directory ), everything should be set up correctly and in the right place but that error keeps happening. (I'm using gcc to compile and am not using an IDE or anything, just a txt editor). Any ideas on what I'm doing wrong? Any help is appreciated.
     
  2. Technicmaster0

    Technicmaster0 GBAtemp Psycho!

    Member
    3,283
    680
    Oct 22, 2011
    Gambia, The
    Is there a space in any folder of the tree of the examples?
     
  3. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
  4. nastys

    nastys ナースティス

    Member
    1,487
    864
    Aug 5, 2014
    Italy
    Earth
    You need to add the following lines to your .bashrc file (it's a hidden file in your home folder):
    Code:
    export DEVKITPRO=/opt/devkitpro
    export DEVKITARM=$DEVKITPRO/devkitARM
    then log out or reboot to apply the changes.

    Alternatively, you can enter them into the terminal before compiling.
     
  5. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    still same error. It can't find the 3ds.h file
     
  6. Melon__Bread

    Melon__Bread ~It's A Magik~

    Member
    710
    400
    Dec 9, 2013
    United States
  7. mid-kid

    mid-kid GBAtemp spamBOT

    Member
    879
    962
    Aug 2, 2012
    I wouldn't install it with that tutorial, but with the automated perl script and in my home directory instead of /opt.
    But, since you seem to do it that way, didn't you notice that nowhere in the tutorial is explained how to install ctrulib?
    EDIT: Also, ctrulib's README.md doesn't explain how to install it.

    Well, to install it, either:
    • Clone the github repo (https://github.com/smealum/ctrulib), go to that directory, run "make" and then "sudo make install".
    • Download it from here, and install it the same way as libnds (in a folder named "libctru").
     
  8. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    Trying to do that, but when I run make I get:
    Makefile:10: EVKITPRO/devkitARM/base_rules: No such file or directory
    make: *** No rule to make target 'EVKITPRO/devkitARM/base_rules'. Stop.
    Here's a copy of the makefile: (with a txt extension so gbatemp will allow me to upload it)
     

    Attached Files:

  9. nastys

    nastys ナースティス

    Member
    1,487
    864
    Aug 5, 2014
    Italy
    Earth
    Start over, but this time follow this tutorial.
    (just enter those commands into a terminal, one by one)
     
  10. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    When I got down to make it gives me this error:

    sdmc_dev.c
    arm-none-eabi-gcc -MMD -MP -MF /opt/devkitpro/ctrulib/libctru/build/sdmc_dev.d -g -Wall -O2 -mword-relocations -fno-strict-aliasing -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/opt/devkitpro/ctrulib/libctru/include -I/opt/devkitpro/ctrulib/libctru/build -DARM11 -D_3DS -c /opt/devkitpro/ctrulib/libctru/source/sdmc_dev.c -o sdmc_dev.o
    /opt/devkitpro/ctrulib/libctru/source/sdmc_dev.c:95:3: error: unknown field 'rmdir_r' specified in initializer
    .rmdir_r = sdmc_rmdir,
    ^
    /opt/devkitpro/ctrulib/libctru/source/sdmc_dev.c:95:3: warning: excess elements in struct initializer
    /opt/devkitpro/ctrulib/libctru/source/sdmc_dev.c:95:3: warning: (near initialization for 'sdmc_devoptab')
    /opt/devkitpro/devkitARM/base_rules:85: recipe for target 'sdmc_dev.o' failed
    make[1]: *** [sdmc_dev.o] Error 1
    Makefile:126: recipe for target 'build' failed
    make: *** [build] Error 2

    (I started from scratch)
     
  11. nastys

    nastys ナースティス

    Member
    1,487
    864
    Aug 5, 2014
    Italy
    Earth
    Which example are you trying to compile exactly?
     
  12. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    none, that was when I did the make command. I was following the tutorial you linked.
     
  13. nastys

    nastys ナースティス

    Member
    1,487
    864
    Aug 5, 2014
    Italy
    Earth
    It worked for me (just tried), maybe you didn't really start from scratch...
    Make sure to remove the entire /opt/devkitpro folder, then try again.
    Code:
    sudo rm -r /opt/devkitpro
     
  14. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    638
    353
    Feb 8, 2015
    Canada
    /dev/null
    and........ sourceforge is down for me. can't connect via 2 different routers, 2 web browsers or via terminal :(
     
  15. mid-kid

    mid-kid GBAtemp spamBOT

    Member
    879
    962
    Aug 2, 2012
    Why did you edit the Makefile?
    Either way, if you really want to edit the makefile instead of just exporting the environment variables, use $(VARIABLENAME) instead of $VARIABLENAME. Makefiles aren't shell scripts.