Homebrew How to install Ctrulib? (Linux)

Monado_III

Well-Known Member
OP
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
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.
 

nastys

ナースティス
Member
Joined
Aug 5, 2014
Messages
1,730
Trophies
0
Age
26
Location
Earth
XP
1,794
Country
Italy
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.
 

mid-kid

GBAtemp spamBOT
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
25
XP
1,163
Country
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").
 

Monado_III

Well-Known Member
OP
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
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").
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)
 

Attachments

  • Makefile.txt
    5.3 KB · Views: 317

Monado_III

Well-Known Member
OP
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
Start over, but this time follow this tutorial.
(just enter those commands into a terminal, one by one)

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)
 

nastys

ナースティス
Member
Joined
Aug 5, 2014
Messages
1,730
Trophies
0
Age
26
Location
Earth
XP
1,794
Country
Italy
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)
Which example are you trying to compile exactly?
 

nastys

ナースティス
Member
Joined
Aug 5, 2014
Messages
1,730
Trophies
0
Age
26
Location
Earth
XP
1,794
Country
Italy
none, that was when I did the make command. I was following the tutorial you linked.
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
 

Monado_III

Well-Known Member
OP
Member
Joined
Feb 8, 2015
Messages
722
Trophies
0
Location
/dev/null
XP
1,443
Country
Canada
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

and........ sourceforge is down for me. can't connect via 2 different routers, 2 web browsers or via terminal :(
 

mid-kid

GBAtemp spamBOT
Member
Joined
Aug 2, 2012
Messages
879
Trophies
0
Age
25
XP
1,163
Country
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)

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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: I am the cancer!!! lol