libcs50
v11.0.3
make : construit une bibliothèque dynamique
make deb : construit le source deb
make install : installe la bibliothèque sous /usr/local par défaut (définissez DESTDIR pour changer cela)
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.deb.sh | sudo bash
$ sudo apt-get install libcs50
$ curl -s https://packagecloud.io/install/repositories/cs50/repo/script.rpm.sh | sudo bash
$ yum install libcs50
libcs50-*.*cd libcs50-*sudo make install Par défaut, nous installons sur /usr/local . Si vous souhaitez modifier l'emplacement d'installation, exécutez sudo DESTDIR=/path/to/install make install comme vous le souhaitez.
/usr/bin/ld: cannot find -lcs50 : Ajoutez export LIBRARY_PATH=/usr/local/lib à votre .bashrc .fatal error: 'cs50.h' file not found : Ajoutez export C_INCLUDE_PATH=/usr/local/include à votre .bashrc .error while loading shared libraries: libcs50.so.8: cannot open shared object file: No such file or directory : Ajoutez export LD_LIBRARY_PATH=/usr/local/lib à votre .bashrc .Fermez et rouvrez toutes les fenêtres du terminal.
Lien avec -lcs50 .
#include <cs50.h>
...
char c = get_char("Prompt: ");
double d = get_double("Prompt: ");
float f = get_float("Prompt: ");
int i = get_int("Prompt: ");
long l = get_long("Prompt: ");
string s = get_string("Prompt: ");
// deprecated as of fall 2017
long long ll = get_long_long("Prompt: ");
Voir man get_* après l'installation ou la référence CS50 !