Hello world problem

Discussion in 'NDS - Emulation and Homebrew' started by Sarvesh50, May 16, 2009.

May 16, 2009

Hello world problem by Sarvesh50 at 10:18 PM (1,532 Views / 0 Likes) 16 replies

  1. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    Ok i open devkitpro programmers notepad
    and then i switch plain text to C/C++

    then i

    #include
    using namespace std;

    int main ()
    {
    cout
     
  2. geocool

    Newcomer geocool Advanced Member

    Joined:
    Jul 31, 2008
    Messages:
    53
    Location:
    Athens
    Country:
    Greece
  3. eSquire

    Newcomer eSquire Advanced Member

    Joined:
    May 12, 2009
    Messages:
    65
    Country:
    Australia
    Programmer's Notepad is just a text editor with syntax-highlighting features and such. It is not a compiler.

    Also, that code you have there is for PCs and won't work on a DS.
     
  4. DanTheManMS

    Member DanTheManMS aka Ricochet Otter

    Joined:
    Jun 2, 2007
    Messages:
    4,325
    Location:
    Georgia
    Country:
    United States
    Including nds.h would be a good start. Also keep in mind the DS has no built-in text rendering engine, or console mode, or anything. LibNDS does contain some working implementations of these things however.

    DevKitPRO comes with a "Hello, World" example for the DS. I'd suggest looking there.
     
  5. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    well did include later nds.h file but stil the compiled nds file id start but it turned a white screen
     
  6. TheLazy1

    Newcomer TheLazy1 Member

    Joined:
    Jan 16, 2008
    Messages:
    14
    Country:
    Canada
    Including nds.h will not make your program magically work [​IMG]
    If you are just learning how to write code I would suggest you start on the PC first since it is so much easier to debug.
     
  7. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    well ok but how much pc progress i need to make to start with the ds?
     
  8. geocool

    Newcomer geocool Advanced Member

    Joined:
    Jul 31, 2008
    Messages:
    53
    Location:
    Athens
    Country:
    Greece
    First You Need To Learn Many Things About C++ Like Fuctions Pointers And All These. You Can't Start programming on DS without knowing how to do it on pc.

    www.cplusplus.com is a nice site to start.

    I want to make homebrews for Ds or Wii too but without the basic knowledge you can't do many things.
     
  9. DanTheManMS

    Member DanTheManMS aka Ricochet Otter

    Joined:
    Jun 2, 2007
    Messages:
    4,325
    Location:
    Georgia
    Country:
    United States
    Again, open the example projects and make sure you can compile them. If THAT fails, then you've got a more serious issue to deal with.
     
  10. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    OK its going to be pc
     
  11. lincruste

    Member lincruste GBAtemp Regular

    Joined:
    Jan 13, 2008
    Messages:
    163
    Location:
    france
    Country:
    Do not forget to try DanTheManMS's advice. Try compiling some examples of code. You might want to test your increasing C skills on your DS, it will be a great source of motivation (is "motivation" an english word by the way? [​IMG] ).
     
  12. ShadowEO

    Member ShadowEO GBAtemp Regular

    Joined:
    Mar 31, 2009
    Messages:
    216
    Location:
    Ohio, USA
    Country:
    United States
    There's no reason that he can't learn C++ while working with the DS. Just keep a Libnds manual open so you can reference functions and their arguments when needed. But you've got the right structure for your hello world, just the wrong commands. But keep working on it and you should be able to get it, Also if your starting for a mix of both graphical and text (virtual keyboard) I suggest you also install PALib. Just keep going, I'm learning C++ too just to work on the DS [​IMG] [​IMG] Just keep being determined to make it work and take alot of time and effort on your code, don't just whip it together and hope for the best, when you think your ready to debug, review your code just one more time, then compile for NDS, Also PALib comes with emulators to test your DS program in so you don't have to transfer your program back and forth everytime you attempt it.

    Good luck Sarvesh and happy coding. If I knew more about C++ than just the structure of the code I'd offer to help you more but I'm still learning myself, even though people say that C++ is just like the web langugage PHP >_> It's not.... [​IMG] but I'm still trying. I hope to make good homebrew someday as well.
     
  13. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    Haha ok but i heard palib is rookie friendler so i better use palib right?
     
  14. TheLazy1

    Newcomer TheLazy1 Member

    Joined:
    Jan 16, 2008
    Messages:
    14
    Country:
    Canada
    I think you need to learn on a platform that is well documented and has a good debugger: a PC for example.
    There is no law saying you can't learn on the DS, it's just going to be more difficult.

    If you are ready, just use libnds.
    There are plenty of examples now and it is designed very well, has documentation and is easy to use.
     
  15. anandjones

    Member anandjones GBAtemp Regular

    Joined:
    Jan 7, 2008
    Messages:
    138
    Location:
    New Zealand
    Country:
    New Zealand
    Sarvesh50, it's a high abstraction library. Use it if you want. The newer libnds APIs makes it a lot easier for sprites, backgrounds without all the control register settings etc.
     
  16. EEragon

    Newcomer EEragon Member

    Joined:
    Jan 27, 2009
    Messages:
    45
    Country:
    Belgium
    For a new nds-programmer, PAlib is the best choice.
    If you are an die-hard nds-programmer, you better can start learning ndslib immediately.

    I'm a rookie programmer, I programming Patapon DS now and I'm using PAlib because libnds is a little to hard for me, and the're no good tutorials for it yet.
     
  17. Sarvesh50
    OP

    Member Sarvesh50 Aye!

    Joined:
    Jul 7, 2008
    Messages:
    915
    Location:
    Netherlands
    Country:
    Netherlands
    Sure then i will use palib [​IMG]
     

Share This Page