libcs50
v11.0.3
make : يبني مكتبة ديناميكية
make deb : يبني deb المصدر
make install : تثبيت المكتبة ضمن /usr/local افتراضيًا (اضبط DESTDIR لتغيير ذلك)
$ 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 افتراضيًا، نقوم بالتثبيت على /usr/local . إذا كنت ترغب في تغيير موقع التثبيت، فقم بتشغيل sudo DESTDIR=/path/to/install make install حسب الرغبة.
/usr/bin/ld: cannot find -lcs50 : قم بإضافة export LIBRARY_PATH=/usr/local/lib إلى .bashrc الخاص بك.fatal error: 'cs50.h' file not found : قم بإضافة export C_INCLUDE_PATH=/usr/local/include إلى .bashrc الخاص بك.error while loading shared libraries: libcs50.so.8: cannot open shared object file: No such file or directory : أضف export LD_LIBRARY_PATH=/usr/local/lib إلى .bashrc الخاص بك.أغلق وأعد فتح أي نوافذ طرفية.
الارتباط مع -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: ");
راجع man get_* بعد التثبيت، أو مرجع CS50!