iostream et STL
Re: iostream et STL
Indeed, galois_field works only with RTTI. Replace at_GF by at_nop in static_lexer_at.h and this time it should link (unless there is another problem with libraries).
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 3511
- Inscription: 13 Déc 2013, 16:35
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
Built!
Its seems to work correctly on the emulator.
Thanks!
Its seems to work correctly on the emulator.
Thanks!
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Messages: 2955
- Images: 3
- Inscription: 10 Sep 2010, 00:00
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
I read the API quick-doc (http://www-fourier.ujf-grenoble.fr/~par ... l#Examples) but I cannot find any reference to UTF-8/unicode.
utf82unicode returns a string which isn't \0\0 terminated. What did I do wrong?
- Code: Tout sélectionner
nio::console console_cin;
console_cin_ptr=&console_cin;
clrscr();
giac::context c;
string s(unicode2utf8(calcul)); // wchar_t* calcul; UTF-16
console_cin.foreground_color(nio::COLOR_GREEN);
giac::gen g(s,&c);
console_cin.foreground_color(nio::COLOR_BLUE);
g=eval(g,&c);
COUT << g << endl; //OK
COUT << g.print() << endl; //OK
bkpt();
utf82unicode(g.print())
utf82unicode returns a string which isn't \0\0 terminated. What did I do wrong?
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Messages: 2955
- Images: 3
- Inscription: 10 Sep 2010, 00:00
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
utf82unicode takes a char * as argument, not a string, the compiler should not compile utf82unicode(g.print()) but utf82unicode(g.print().c_str()) should work and return a 0 terminated wchar_t * (it is allocated using varname=new wchar_t[size+1]; therefore should be deleted by delete [] varname)
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 3511
- Inscription: 13 Déc 2013, 16:35
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
Actually, sizeof(wchar_t) seems to be 4. The final 0 is thus placed too far (UTF-16 would rather have a 2-bytes-long char type) with
(plus it stores a 4 bytes \0 instead of a 2 bytes \0)
If (wline) wline[j] = 0;
.(plus it stores a 4 bytes \0 instead of a 2 bytes \0)
-
ExcaleAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Messages: 2955
- Images: 3
- Inscription: 10 Sep 2010, 00:00
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
Just for the sake of getting everything to compile, only ustl fails, for me :
I've tried changing some things in the Config.mk, to no avail... :/
How did you get it to link ?
giac works fine with your .a
Edit : well, creating a main.cc with just
- Code: Tout sélectionner
ld (ld-elf2flt): -shared used without passing a shared library ID
I've tried changing some things in the Config.mk, to no avail... :/
How did you get it to link ?
giac works fine with your .a
Edit : well, creating a main.cc with just
int main(void) { return 0; }
, and removing the "-shared" in slib (config.mk), it did link correctly... and giac still works correctly 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...)-
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)- Messages: 14617
- Images: 1218
- Inscription: 01 Juin 2007, 00:00
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- Twitter/X: adriweb
- GitHub: adriweb
Re: iostream et STL
Indeed, I was mistaken, unicode is not UTF16 (except maybe on windows?), sizeof(wchar_t)==4 and not 2. It seems there are UTF8 to UTF16 converter in global.cc:
they just need to be declared in global.h in order to be used.
- Code: Tout sélectionner
unsigned int ConvertUTF8toUTF16 (
const UTF8* sourceStart, const UTF8* sourceEnd,
UTF16* targetStart, UTF16* targetEnd, ConversionFlags flags);
unsigned int ConvertUTF16toUTF8 (
const UTF16* sourceStart, const UTF16* sourceEnd,
UTF8* targetStart, UTF8* targetEnd, ConversionFlags flags);
they just need to be declared in global.h in order to be used.
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 3511
- Inscription: 13 Déc 2013, 16:35
- Genre:
- Calculatrice(s):→ MyCalcs profile
Re: iostream et STL
In C11, one can use char16_t and char32_t... but few library functions can deal with those, and C11 support in the real world remains lackluster for now (I faced the problem for libhpcalcs).
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
-
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)- Messages: 6859
- Inscription: 23 Déc 2009, 00:00
- Localisation: France
- Genre:
- Calculatrice(s):→ MyCalcs profile
- Classe: -
- GitHub: debrouxl
Re: iostream et STL
Updated:
1/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/giac.tgz to version 1.1.1, including export of utf8 to utf16 conversion functions.
2/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/nspire-io.tar.bz2 change to dtostr (some doubles were not printed correctly at all)
3/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/ndless.tar.bz2: cmath changed, inline definition for abs did not work, changed to
1/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/giac.tgz to version 1.1.1, including export of utf8 to utf16 conversion functions.
2/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/nspire-io.tar.bz2 change to dtostr (some doubles were not printed correctly at all)
3/ http://www-fourier.ujf-grenoble.fr/~parisse/calc/ndless.tar.bz2: cmath changed, inline definition for abs did not work, changed to
- Code: Tout sélectionner
inline double abs(double d){ return (d<0)?-d:d;}
-
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)- Messages: 3511
- Inscription: 13 Déc 2013, 16:35
- Genre:
- Calculatrice(s):→ MyCalcs profile
Retourner vers Native: Ndless, Linux, ...
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 19 invités