Hello world problem

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

  1. Sarvesh50
    OP

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    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

    geocool Advanced Member

    Newcomer
    54
    8
    Jul 31, 2008
    Greece
    Athens
  3. eSquire

    eSquire Advanced Member

    Newcomer
    65
    0
    May 12, 2009
    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

    DanTheManMS aka Ricochet Otter

    Member
    4,329
    105
    Jun 2, 2007
    United States
    Georgia
    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

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    Netherlands
    well did include later nds.h file but stil the compiled nds file id start but it turned a white screen
     
  6. TheLazy1

    TheLazy1 Member

    Newcomer
    14
    0
    Jan 16, 2008
    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

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    Netherlands
    well ok but how much pc progress i need to make to start with the ds?
     
  8. geocool

    geocool Advanced Member

    Newcomer
    54
    8
    Jul 31, 2008
    Greece
    Athens
    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

    DanTheManMS aka Ricochet Otter

    Member
    4,329
    105
    Jun 2, 2007
    United States
    Georgia
    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

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    Netherlands
    OK its going to be pc
     
  11. lincruste

    lincruste GBAtemp Regular

    Member
    241
    45
    Jan 13, 2008
    Antarctica
    france
    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

    ShadowEO GBAtemp Advanced Fan

    Member
    525
    164
    Mar 31, 2009
    United States
    Ohio, USA
    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

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    Netherlands
    Haha ok but i heard palib is rookie friendler so i better use palib right?
     
  14. TheLazy1

    TheLazy1 Member

    Newcomer
    14
    0
    Jan 16, 2008
    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

    anandjones GBAtemp Regular

    Member
    138
    0
    Jan 7, 2008
    New Zealand
    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

    EEragon Member

    Newcomer
    45
    0
    Jan 27, 2009
    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

    Sarvesh50 Aye!

    Member
    915
    11
    Jul 7, 2008
    Netherlands
    Netherlands
    Sure then i will use palib [​IMG]