1

I'm running the CS50 tools on my Linux Mint 17.1 KDE partition on my Toshiba Satellite E55t-A5320 laptop. I set everything up using this link:

How to Install the Tools for the Course on Ubuntu

However, when I try to compile the code with

make50

which I have set up an alias in

~/.bash_aliases

as

alias make50='make CC=clang CFLAGS="-ggdb3 -O0 -std=c99 -Wall -Werror" LDLIBS="-lcs50 -lm"'

I get this strange error:

pythonhax@PYTHONHAX-MINTKDE:~/Dropbox/CS50x/pset2$ make50 vigenere
clang -ggdb3 -O0 -std=c99 -Wall -Werror    vigenere.c  -lcs50 -lm -o vigenere
/usr/bin/ld: cannot find -lcs50
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [vigenere] Error 1
pythonhax@PYTHONHAX-MINTKDE:~/Dropbox/CS50x/pset2$ 

Output of

ld -lcs50 --verbose | grep attempt

is:

pythonhax@PYTHONHAX-MINTKDE:~$ ld -lcs50 --verbose | grep attempt
ld: cannot find -lcs50
attempt to open /usr/x86_64-linux-gnu/lib64/libcs50.so failed
attempt to open /usr/x86_64-linux-gnu/lib64/libcs50.a failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libcs50.so failed
attempt to open //usr/local/lib/x86_64-linux-gnu/libcs50.a failed
attempt to open //usr/local/lib64/libcs50.so failed
attempt to open //usr/local/lib64/libcs50.a failed
attempt to open //lib/x86_64-linux-gnu/libcs50.so failed
attempt to open //lib/x86_64-linux-gnu/libcs50.a failed
attempt to open //lib64/libcs50.so failed
attempt to open //lib64/libcs50.a failed
attempt to open //usr/lib/x86_64-linux-gnu/libcs50.so failed
attempt to open //usr/lib/x86_64-linux-gnu/libcs50.a failed
attempt to open //usr/lib64/libcs50.so failed
attempt to open //usr/lib64/libcs50.a failed
attempt to open //usr/local/lib/libcs50.so failed
attempt to open //usr/local/lib/libcs50.a failed
attempt to open //lib/libcs50.so failed
attempt to open //lib/libcs50.a failed
attempt to open //usr/lib/libcs50.so failed
attempt to open //usr/lib/libcs50.a failed
5
  • Can you add the output of ld -lcs50 --verbose | grep attempt to your post? – Calculemus Jan 11 '15 at 2:44
  • OK, I just added it. Running with sudo gives the same output. – pythonhax Jan 11 '15 at 14:46
  • 1
    I solved it by copying the Debian/Ubuntu installation steps from manual.cs50.net/library into a new file ~/Desktop/library.sh and running sudo sh library.sh – pythonhax Jan 12 '15 at 14:24
  • Nicely done, and thanks for the update. Your solution, along with the ld output, suggests that you probably skipped a step when you performed those steps manually. Do you see a successful open attempt on //usr/local/lib/libcs50.a when you run the ld command now? – Calculemus Jan 13 '15 at 1:03
  • No, in fact I had just downloaded cs50.h and copied it into /usr/include. Running ld still fails unfortunately. – pythonhax Jan 13 '15 at 16:25

You must log in to answer this question.

Browse other questions tagged .