π
<-
Chat plein-écran
[^]

[Solved] Cannot make Ndless-SDK on Windows 10

C, C++, ASM...

[Solved] Cannot make Ndless-SDK on Windows 10

Message non lude santacruz » 22 Avr 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: Tout sélectionner
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: Tout sélectionner
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.
Avatar de l’utilisateur
santacruz
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Prochain niv.: 56%
 
Messages: 6
Inscription: 21 Mar 2016, 21:17
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Retourner vers Native: Ndless, Linux, ...

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 32 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1659 utilisateurs:
>1622 invités
>32 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)