Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: compu on March 27, 2011, 01:32:22 pm

Title: C++ on the Nspire?
Post by: compu on March 27, 2011, 01:32:22 pm
I have tried to run C++ on the Nspire by replacing gcc with g++ in nspire-gcc, but the linker spams me with error messages then.
I got this to work once (with r349 I guess), so I was able to make a class with a function that prints something to RS232, but I was unable to use functions of libndls. I don't know how I exactly did this anymore (I reinstalled windows), so my question is, how can I get C++ to work again? If there is a chance to do this, wouldn't it be nice to include an nspire-g++ into ndless then?
Title: Re: C++ on the Nspire?
Post by: Munchor on March 27, 2011, 01:56:21 pm
I have tried to run C++ on the Nspire by replacing gcc with g++ in nspire-gcc, but the linker spams me with error messages then.
I got this to work once (with r349 I guess), so I was able to make a class with a function that prints something to RS232, but I was unable to use functions of libndls. I don't know how I exactly did this anymore (I reinstalled windows), so my question is, how can I get C++ to work again? If there is a chance to do this, wouldn't it be nice to include an nspire-g++ into ndless then?

First of all, I'm surprised you managed to get C++ on the NSpire on the first place.
Have no idea how to fix it now, though.
Title: Re: C++ on the Nspire?
Post by: Lionel Debroux on March 27, 2011, 02:04:14 pm
Perhaps some extern "C" { ... }; blocks would be in order ?

C++ on a Nspire is not really surprising, in fact :)
C++ code is not necessarily bloated (though the more advanced features can indeed yield significant bloat) and hard to compile for embedded platforms: in the absence of "virtual" stuff, things like inheritance and redefinition of some methods' implementation in derived classes, can be compiled to decent machine code. My team-mate (mostly) and I used such C++ code in the internship at the end of our studies, on a mildly embedded platform (several hundreds of KB of Flash memory).
Title: Re: C++ on the Nspire?
Post by: DJ Omnimaga on March 27, 2011, 02:42:50 pm
Wow I didn't realize C++ was possible on it. Isn't C++ OOP btw? O.O

By the way shouldn't this be in the calculator help/C sub-forum?
Title: Re: C++ on the Nspire?
Post by: compu on March 27, 2011, 02:49:56 pm
Wow I didn't realize C++ was possible on it. Isn't C++ OOP btw? O.O
Yes, it is.

By the way shouldn't this be in the calculator help/C sub-forum?
Uhm, I don't know. Feel free to move it :P
Title: Re: C++ on the Nspire?
Post by: compu on March 30, 2011, 07:36:40 am
Nobody has a solution?
Title: Re: C++ on the Nspire?
Post by: AngelFish on March 30, 2011, 07:44:42 am
Has C++ been ported to ARM9? If it has, it might be best just to use a dedicated toolchain.

EDIT: Well, obviously C++ has been at least partially ported...
Title: Re: C++ on the Nspire?
Post by: fb39ca4 on June 24, 2011, 12:26:25 am
Anyone tried using C++ again with newer versions of ndless? If it works, then I might use it.