iostream et STL
Re: iostream et STL
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)).
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)).
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 2955
- Images: 3
- Joined: 10 Sep 2010, 00:00
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
Maybe with
using namespace ustl
in files where it's used, but... I believe it's considered "bad" practice for portability reasons, so... not sureMyCalcs: 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
-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 14857
- Images: 1211
- Joined: 01 Jun 2007, 00:00
- Location: France
- Gender:
- Calculator(s):→ MyCalcs profile
- Twitter: adriweb
- GitHub: adriweb
Re: iostream et STL
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?
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?
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3814
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
I started the whole process again:
-DL giac ==> extract
-Clean giac
-Build giac ==> tommath.h missing
-DL libtommath ==> extract to
-Clean libtommath
-Build libtommath ==> OK, put libtommath.a in
-Build giac ==>
-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
-DL .ndless ==> extract
-Build giac ==>
-Clean ustl
-Build ustl ==>
-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
%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
%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'
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 2955
- Images: 3
- Joined: 10 Sep 2010, 00:00
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
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).
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).
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3814
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
I commented out all of theses conflicts. The linking part fails.
Anyway, I put your libustl.a in
-Build giac:
- 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
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 2955
- Images: 3
- Joined: 10 Sep 2010, 00:00
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
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.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3814
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
I thought it was already in the Makefile, but you put a # just before (I did not see it
).
Anyway, removed the #.
Build again. Same error but further (??).

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
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 2955
- Images: 3
- Joined: 10 Sep 2010, 00:00
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
Remove quater.o from the Makefile.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Posts: 3814
- Joined: 13 Dec 2013, 16:35
- Gender:
- Calculator(s):→ MyCalcs profile
Re: iostream et STL
OK.
EDIT: I can't find "galois" in static_lexer_at.h nor input_lexer.cc
- 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
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Posts: 2955
- Images: 3
- Joined: 10 Sep 2010, 00:00
- Gender:
- Calculator(s):→ MyCalcs profile
Return to Native: Ndless, Linux, ...
Who is online
Users browsing this forum: No registered users and 8 guests