1. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    Could someone help? I keep getting this error when I run make.
    /Users/user/Desktop/3DSBREWMAKER/Platformer/source/jsoncpp.cpp: In function 'void Json::throwRuntimeError(const string&)':

    /Users/user/Desktop/3DSBREWMAKER/Platformer/source/jsoncpp.cpp:2618:25: error: exception handling disabled, use -fexceptions to enable

    throw RuntimeError(msg);

    ^
     
  2. nop90

    nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    You can't sue exceptions with 3ds toolchain configuration.

    You can try to change the code using old style error handling.
     
  3. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    I was asking what does this error mean, what caused it, and how can I fix it? Also, what's old style error handling? Try/catch blocks?
     
  4. nop90

    nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    this means that in the code you can'y use exceptions (i.e try/catch)

    the -fno-exceptions in your makefile

    you can't (at least if ctrulib isn't deeply changed in the last six months). If you don't beleve me, remove the -fno-exceptions flag.

    old style is to use some integer return values (usually negative ones) to signal an error inside a function. An other ugly method could be to use global variables, but do this only as last option.
     
  5. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    I just pushed the source to github, if you could tell me where I went wrong, that would be very helpful. https://github.com/trainboy2019/Platformer
     
  6. nop90

    nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    I don't like to be rude, and usually I try to give all the support I can, but this is the third time you ask the same thing.

    You are wrong exactly in the point reported by the compiler:
    Code:
    /Users/user/Desktop/3DSBREWMAKER/Platformer/source/jsoncpp.cpp:2618:25: error: exception handling disabled, use -fexceptions to enable
    
    throw RuntimeError(msg);
    
    I hope you can read it. It reports:
    - file jsoncpp.cpp
    - row 2618
    - col 25

    the problem is using throwRuntimeError(...), and it's used in several points (only the first one is reported).

    As I already said, you can't use exceptions, and throwRuntimeError(...) throws an exception :O.

    For learning what's an exceprion, use google

    PS: sorry to be have been rude, today is a bad day and I need someone to (virtually) punch :rofl2:. If you need ask more.

    PPS: for a quick and dirty hack, try to comment all the throwRuntimeError(...). This way error handling will be disabled (with the risk of the app crashing), but you could be lucky.
     
  7. ghjfdtg

    ghjfdtg GBAtemp Advanced Fan
    Member

    Joined:
    Jul 13, 2014
    Messages:
    550
    Country:
  8. nop90

    nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    just googled for "site:gbatemp.net nop90 home menu homebrew developement"

    what you need is here https://gbatemp.net/threads/homebrew-development.360646/page-264#post-6968395

    you have to pause music after
    Code:
    case APTHOOK_ONSUSPEND:
    
    if you set a global variable to true there, in the mainloop you can check if the music is paused (just in case the game is restored after pressing home) and make it start again, clearing the global variable obviously.
    It's a code example. there is no advanced tutorial for coding on 3ds. Sorry.
     
    Last edited: Feb 10, 2018
    ElijahZAwesome likes this.
  9. MaiconErick

    MaiconErick GBAtemp Regular
    Member

    Joined:
    Jan 4, 2016
    Messages:
    120
    Country:
    Brazil
    Is there a wait or pause command?
    I couldn't find more info about this.
     
  10. nop90

    nop90 GBAtemp Advanced Maniac
    Member

    Joined:
    Jan 11, 2014
    Messages:
    1,556
    Country:
    Italy
    svcSleepThread(u64 nanoseconds);
     
    MaiconErick likes this.
  11. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    So I pushed some changes to the platform code, and it loads the json, but for some reason the keypress detections aren't working. I'm not sure where I went wrong. https://github.com/trainboy2019/Platformer
     
  12. NicknameGoesHere

    NicknameGoesHere RIP my sanity: 2018-2018
    Member

    Joined:
    Jul 11, 2017
    Messages:
    243
    Country:
    United States
    Every time I try to use Code::Blocks to try to build and run my program, I get the error "/c/devkitPRO/devkitARM/3ds_rules: No such file or directory." I checked, and the file 3ds_rules is in the C/devkitPro/devkitARM directory.
     
  13. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    Do you have the path variable set? I think that's how it works on windows.
     
  14. NicknameGoesHere

    NicknameGoesHere RIP my sanity: 2018-2018
    Member

    Joined:
    Jul 11, 2017
    Messages:
    243
    Country:
    United States
    I think so
     
  15. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    Could you check?
     
  16. NicknameGoesHere

    NicknameGoesHere RIP my sanity: 2018-2018
    Member

    Joined:
    Jul 11, 2017
    Messages:
    243
    Country:
    United States
    I'm very new to c/c++, I don't know what to look for. I have a default makefile with no changes made to it, so I don't know what's going on.
     
  17. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    No, it's in your settings iirc, windows isn't my specialty.
     
  18. NicknameGoesHere

    NicknameGoesHere RIP my sanity: 2018-2018
    Member

    Joined:
    Jul 11, 2017
    Messages:
    243
    Country:
    United States
    Ok, I fixed that problem. Now, whenever I try to build and run in citra, I always get the error "recipe for target 'citra' failed."
     
  19. trainboy2019

    trainboy2019 Well-Known Member
    Member

    Joined:
    Oct 6, 2015
    Messages:
    1,114
    Country:
    United States
    What's the best way to generate random numbers 1-4?
    This is what I have now.
    Code:
        default_random_engine engine;
        uniform_int_distribution<int> distributor(1,4);
        key=distributor(engine);
    But it generates the same random numbers in the same order every time.
     
  20. BubbleChien

    BubbleChien Newbie
    Newcomer

    Joined:
    Feb 23, 2018
    Messages:
    3
    Country:
    France
    You need to seed the random engine, for example :

    Code:
    engine.seed(std::random_device()());
     
Draft saved Draft deleted
Loading...

Hide similar threads Similar threads with keywords - Development, Homebrew,