0

I seem to be having a problem accessing the cs50.h library. I've run update50 and, as of this writing, I appear to be running version 98. I have typed in exactly what was shown on a part of the walkthrough video for problem set 1 and, when I attempt to compile, I receive the following:

"~/workspace/pset1/ $ clang test.c

/tmp/test-0f7a5a.o: In function 'main': test.c:(.text+0x9): undefined reference to 'get_int' clang: error: linker command failed with exit code 1 (use -v to see invocation)"

The program test.c is as follows (in its entirety):

#include <cs50.h>

int main(void)

{

get_int();

}

I have tried restarting, logging back out and back in, closing and re-opening files and terminal windows, even restoring factory settings and re-downloading the update with the update50 command.

Edit: For what it's worth, I've also deleted and 'reinstalled' the workspace on Cloud9 and re-running update50. I've also tried getint() and GetInt() but to no avail. GetInt() and get_int() give me nearly identical error messages, getint() returns an error saying it's not in c99.

I'm also running CS50 IDE in google chrome on a older (2010) MacBook Pro, in case that's relevant.

Any help would be greatly appreciated.

Thank you!

1 Answer 1

1

The compiler command is make test (unless you want to supply all the switches for clang). Notice that make echos to the terminal the actual clang command it uses.

1
  • Thank you so much - that was driving me insane. I didn't realize you had to use "make" instead of "clang" when using the cs50 library. Much obliged!
    – Matt
    Feb 20, 2017 at 22:21

You must log in to answer this question.

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