π
<-

iostream et STL

C, C++, ASM...

Re: iostream et STL

Postby Excale » 02 May 2014, 20:26

Yes, I tried to compile your latest version without success.
J'avoue ne pas y connaître grand chose en C++, et je ne vois vraiment pas (entre autres) comment faire marcher <pair> (puisque je ne vois aucun fichier nommé "pair" à inclure sans ustl (il y a bien un upair.h, mais je ne suis allé nulle part avec ça)).
User avatar
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 3.9%
 
Posts: 2955
Images: 3
Joined: 10 Sep 2010, 00:00
Gender: Male
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby Adriweb » 02 May 2014, 20:32

Maybe with using namespace ustl in files where it's used, but... I believe it's considered "bad" practice for portability reasons, so... not sure

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 82%
 
Posts: 14857
Images: 1211
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

Re: iostream et STL

Postby parisse » 08 May 2014, 16:09

Sorry for the delay, I did not look at the forum since a while because things seemed stalled.
It's not bad practice, as long as you do it in your implementation files and not in headers.
For the giac nspire port, I added a define in config.h so that std is the same as ustl. All implementation files of giac begin with using namespace std; hence ustl namespace should be exported.
If you have a problem compiling giac for nspire, can you report the precise error message?
Or did you try to compile your own program using giac?
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 94.5%
 
Posts: 3814
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby Excale » 09 May 2014, 13:20

I started the whole process again:
-DL giac ==> extract src/ to %ndlessprogs%/giac/
-Clean giac
-Build giac ==> tommath.h missing
-DL libtommath ==> extract to %ndlessprogs%/giac/libtommath/
-Clean libtommath
-Build libtommath ==> OK, put libtommath.a in %home%/.ndless/lib and tommath.h, tommath_class.h, tommath_superclass.h in %home%/.ndless/include
-Build giac ==>
  • Code: Select all
       gmp_replacements.h: In function 'double mpz_get_d(const mpz_t&)':
       gmp_replacements.h:130:20: error: 'Strtod' was not declared in this scope
  • That's some non standard nspireio
-DL nspireIO ==> extract it to %ndlessprogs%/giac/nspireIO/
-Build nspireIO ==> OK, rename libnspireio.a to libnspireiogiac.a (to make sure it does not conflict with the "regular" one), change lnspireio to lnspireiogiac in giac makefile, put libnspireiogiac.a in %home%/.ndless/lib
-DL .ndless ==> extract nspireio/ in %home%/.ndless/include/nspireio/
-Build giac ==>
  • Code: Select all
    monomial.h:30:16: fatal error: pair: No such file or directory
-DL ustl ==> extract it to %ndlessprogs%/giac/ustl/
-Clean ustl
-Build ustl ==>
  • Code: Select all
    In file included from .../ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/sys/_default_fcntl.h:180:0,
                     from .../ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/sys/fcntl.h:3,
                     from .../ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/fcntl.h:1,
                     from fstream.cc:9:
    .../ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/sys/stat.h: At global scope:
    .../ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/sys/stat.h:25:8: error: redefinition of 'struct stat'
    .../Ndless-SDK/ndless/bin/../include/common.h:335:8: error: previous definition of 'struct stat'
-I'm stuck
User avatar
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 3.9%
 
Posts: 2955
Images: 3
Joined: 10 Sep 2010, 00:00
Gender: Male
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby parisse » 10 May 2014, 12:24

Seems to be an incompatibility between the toolchain includes and common.h in the SDK. Try to comment line 180 (#include<sys/stat.h>) in ndless-sdk/yagarto/lib/gcc/../../arm-none-eabi/sys-include/sys/_default_fcntl.h
Or copy the compiled ustl library from .o/libustl.a that is in the archive to your .ndless/lib, and the headers *.h to .ndless/include (we don't really care about the ustl once it works, there is no reason to modify it).
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 94.5%
 
Posts: 3814
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby Excale » 10 May 2014, 13:42

I commented out all of theses conflicts. The linking part fails.
Code: Select all
Linking libustl.so.1.6 ...
ld (ld-elf2flt): -shared used without passing a shared library ID
collect2: ld returned 1 exit status
ln: creating symbolic link `libustl.so' to `libustl.so.1.6': No such file or directory


Anyway, I put your libustl.a in %home%/.ndless/lib, all the associated .h and .nothing (from the .ndless you uploaded) in %home%/.ndless/include.

-Build giac:
  • Code: Select all
    misc.cc: In function 'giac::gen giac::_pmin(const giac::gen&, const giac::context*)':
    misc.cc:1183:68: error: 'dynamic_cast' not permitted with -fno-rtti
User avatar
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 3.9%
 
Posts: 2955
Images: 3
Joined: 10 Sep 2010, 00:00
Gender: Male
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby parisse » 10 May 2014, 14:06

You can remove -fno-rtti in your nspire-g++ script (I don't see any valid reason to remove support for run-time type identification). If you don't want to change that script, you can add -DNO_RTTI to the options when compiling giac.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 94.5%
 
Posts: 3814
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby Excale » 10 May 2014, 14:57

I thought it was already in the Makefile, but you put a # just before (I did not see it :P).

Anyway, removed the #.
Build again. Same error but further (??).
Code: Select all
quater.cc: In constructor 'giac::quaternion::quaternion(const giac::gen&)':
quater.cc:68:73: error: 'dynamic_cast' not permitted with -fno-rtti
User avatar
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 3.9%
 
Posts: 2955
Images: 3
Joined: 10 Sep 2010, 00:00
Gender: Male
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby parisse » 10 May 2014, 15:08

Remove quater.o from the Makefile.
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 94.5%
 
Posts: 3814
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: iostream et STL

Postby Excale » 10 May 2014, 15:21

OK.
Code: Select all
input_lexer.o: In function `builtin_lexer_functions_':
%ndlessprogs%\giac/static_lexer_at.h:201: undefined reference to `giac::at_galois_field'
collect2: ld returned 1 exit status


EDIT: I can't find "galois" in static_lexer_at.h nor input_lexer.cc
User avatar
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 3.9%
 
Posts: 2955
Images: 3
Joined: 10 Sep 2010, 00:00
Gender: Male
Calculator(s):
MyCalcs profile

PreviousNext

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 8 guests

Surprise...
-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1360 utilisateurs:
>1345 invités
>7 membres
>8 robots
Record simultané (sur 6 mois):
29271 utilisateurs (le 11/07/2025)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)