Noob HB dev questions

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

  1. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    So I just started learning C but I'd like to eventually get into making 3ds homebrew. But I have several question that I can't find answers to; A)Can I set up Code::Blocks as my IDE for homebrew development and B)What IDE am I suppose to use if it's not Code::Blocks and how do I set it up? (I already have the DevKitARM installed on my Fedora and Mint installations)

    Sorry, if these questions seem stupidly obvious but I'm only in Gr. 9 and this: http://3dbrew.org/wiki/Setting_up_Development_Environment didn't help me that much.
     
  2. Lenan

    Lenan GBAtemp Regular

    Member
    172
    65
    Feb 1, 2015
    Swaziland
    You can use whichever IDE you want.
    1.Create new empty project and skip setup page.
    2. Right click your project -> properties -> in Project settings, check "This is a custom Makefile".
    2.2 If you want auto-completion: Right click project -> properties -> "C/C++ parser options" -> add -> x\devkitPro\libctru\include (x= is your path to the devkit folder)
    3. (Not sure about this one) still in project properties -> build targets -> switch type to "commands only".

    I didn't actually test this (except for auto completion) but i hope this brings you on the right track :P

    If it doesn't, I recommend Netbeans and then just follow the instructions on that link you posted.
     
  3. Rinnegatamante

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Lenan likes this.
  4. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    The 3dbrew intrutions say: "It will fail to build. Now edit Makefile and insert these two lines, adjusting for your devkitpro path, at the top"

    Where in the top of the makefile?
     
  5. Lenan

    Lenan GBAtemp Regular

    Member
    172
    65
    Feb 1, 2015
    Swaziland
    Sorry, I have no clue. I'm on Windows and I just use the default one (pretty much every hb source uses the same one) and it works fine for me.
     
  6. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,711
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    You can place them at the "top" of makefile.
    edit it, and past the lines on line 1 so all the other commands in the makefile will know where the "devkitpro" and "devkitarm" variable environment are pointing to.
     
    Monado_III likes this.
  7. Slushie3DS

    Slushie3DS Cold Beverage Lover

    Member
    707
    294
    Jan 9, 2015
    United States
    I just use Gedit, a native Linux plain text editor, and do what Cyan just said. Although, that's just the bare mineral approach, and I don't recommend it unless you're really good at debugging without help.
     
  8. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    Wow a mod responded! Ok, so when I try to build one of the examples using make this happens in the Terminal;

    'main.c
    arm-none-eabi-gcc -MMD -MP -MF /home/myname/Documents/ctrulib-master/examples/app_launch/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/home/myname/Documents/ctrulib-master/examples/app_launch/include -I/opt/devkitpro/libctru/include -I/home/myname/Documents/ctrulib-master/examples/app_launch/build -DARM11 -D_3DS -c /home/myname/Documents/ctrulib-master/examples/app_launch/source/main.c -o main.o
    linking app_launch.elf
    /opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: error: main.o uses VFP register arguments, /home/myname/Documents/ctrulib-master/examples/app_launch/app_launch.elf does not
    /opt/devkitpro/devkitARM/lib/gcc/arm-none-eabi/4.9.2/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file main.o
    collect2: error: ld returned 1 exit status
    /opt/devkitpro/devkitARM/3ds_rules:37: recipe for target '/home/myname/Documents/ctrulib-master/examples/app_launch/app_launch.elf' failed
    make[1]: *** [/home/myname/Documents/ctrulib-master/examples/app_launch/app_launch.elf] Error 1
    Makefile:125: recipe for target 'build' failed
    make: *** [build] Error 2'

    What am I doing wrong? BTW I really appreciate you guys helping me. I feel like an absolute idiot right now.
     
  9. Slushie3DS

    Slushie3DS Cold Beverage Lover

    Member
    707
    294
    Jan 9, 2015
    United States
    From the looks of that, it seems you're missing app_launch.elf.

    Also, don't feel bad. Everyone starts somewhere.
     
  10. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    How would I create an .elf? When I try to build the file from Netbeans it gives me the same error.
     
  11. Slushie3DS

    Slushie3DS Cold Beverage Lover

    Member
    707
    294
    Jan 9, 2015
    United States
    If you look at that error message, you can see where the .elf is supposed to be located. Whatever you're trying to do seems to be attempting to grab an example .elf from the ctrulib-master, which you do not have. Did you install those examples?
     
  12. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    Well, I've downloaded those examples, and I'm trying to turn one into a 3dsx for future reference on how to build 3dsx's and to make sure my IDE is set up properly.
     
  13. Lenan

    Lenan GBAtemp Regular

    Member
    172
    65
    Feb 1, 2015
    Swaziland
    I just made a new clone of ctrulib+examples and build the app_launch with no problems.

    Did you modify the makefile? If so, undo your changes, try again, and report back. :P
     
  14. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    I only modified the top with the export stuff. Take that away and you'll get a error message.
    (export DEVKITPRO=/opt/devkitpro and export DEVKITARM=/opt/devkitpro/devkitARM)
     
  15. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,711
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    Moderators are normal people !
    we are part of the users and are here because we like to help and because we love same things as others (homebrew, video games, dev, etc.)

    I don't have linux, and I'm also a noob in lot of domains, I'm also learning homebrew development. just take your time and read a lot to understand what you see and what you do.

    arm-none-eabi/bin/ld: error: main.o uses VFP register arguments,
    examples/app_launch/app_launch.elf does not

    It's not crashing on compilation (creating the objects). It seems to crash when linking the compiled objects (the .o) to create the elf file (the final executable). linker and compiler are maybe not using the same "method" ? (like I said, I don't know a lot, I'm learning too. I don't know what VFP arguments are)
    verify your environment, if your are using latest devkitpro and libctru. (it should include proper .ld file used to link the objects)
     
  16. Lenan

    Lenan GBAtemp Regular

    Member
    172
    65
    Feb 1, 2015
    Swaziland
    ok try this:
    in the makefile set -mfloat-abi=hard to -mfloat-abi=softfp
     
  17. Monado_III
    OP

    Monado_III GBAtemp Advanced Fan

    Member
    636
    349
    Feb 8, 2015
    Canada
    /dev/null
    Didn't do anything as far as I can tell.