0

I'm getting the following error after running make hello. I downloaded the latest version of libcs50from the GitHub releases page and installed using sudo make install.

I'm running the program on Fedora 29 with zsh as my default shell.

enter image description here

Here's my code:

enter image description here

1

Compiler does not complain about missing cs50.h, so that looks right.

The linker does complain, though, and that's probably because you did not pass -lcs50 when compiling (telling the linker to consider cs50 library). make likely pulls that list from the LDLIBS environment variable, so you can add it there, or create a makefile mentioning that lib.

3
  • Thanks for the response! Could you elaborate a bit on how to add lcs50 to the LDLIBS environment variable? I've never modified environment variables before, and it's my first time being introduced to the concept of a makefile. – Aadil Ayub Jan 15 '19 at 15:39
  • zsh.sourceforge.net/Guide/zshguide02.html 2.5.10: Environment variables. I guess something like export LDLIBS="${LDLIBS} -lcs50" might work. – Blauelf Jan 15 '19 at 16:06
  • This worked! Thank you! – Aadil Ayub Jan 15 '19 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .