π
<-

[Solved] Cannot make Ndless-SDK on Windows 10

C, C++, ASM...

[Solved] Cannot make Ndless-SDK on Windows 10

Unread postby santacruz » 22 Apr 2016, 07:33

I just installed Windows 10 on a new computer and tried installing the SDK. Loaded everything, built the SDK toolchain, then started trying to make the project.

I kept getting an error saying strnlen was not declared.

Code: Select all
genzehn.cpp: In function ‘std::string zehn_get_string(uint32_t, std::vector<unsigned char>&)’:
genzehn.cpp:39:73: error: ‘strnlen’ was not declared in this scope
     return std::string(start, strnlen(start, extra_data.size() - pos - 1));


A simple search will point you to a StackOverFlow article explaining <cstring> isn't included in the file. Well, open up /ndless/ndless-sdk/tools/luna/genzehn.cpp, look at the third line, and it is included.

Turns out strnlen was a Linux-specific function and cross platform compiling may not be supported. More http://stackoverflow.com/questions/30203551/undefined-reference-to-strnlen-despite-string-h-include

So, the easiest fix is just include the original strnlen code http://stackoverflow.com/questions/21536064/how-does-strnlen-work-in-c

Code: Select all
size_t strnlen(const char *s, size_t max_len)
{
    size_t i = 0;
    for(; (i < max_len) && s[i]; ++i);
    return i;
}


Copy this in somewhere above line 39 and you're good to go.


I hope this helps someone. I didn't find it documented anywhere, then again, I didn't look very hard.
User avatar
santacruz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 56%
 
Posts: 6
Joined: 21 Mar 2016, 21:17
Gender: Not specified
Calculator(s):
MyCalcs profile

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: ClaudeBot [spider] and 4 guests

-
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.
1517 utilisateurs:
>1505 invités
>6 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
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)