我正在尝试在 linux 上学习 cs50 ,我下载了在 github 上找到的所有内容,但现在我无法使用 make 编译我的第一个程序,但我可以使用 clang 代替,clang hello.c -lcs50 -o hello它工作得很好,但是当我尝试使用编译时,make hello我得到
:~/cs50/pset1# make hello
cc hello.c -o hello
/usr/bin/ld: /tmp/cczILfhu.o: in function 'main':
hello.c:(.text+0x1a): undefined reference to 'get_string'
collect2: error: ld returned 1 exit status
make: *** [<builtin>: hello] Error 1
Run Code Online (Sandbox Code Playgroud)
我什至将下载的 libcs50 文件夹移动到 /usr/include/ 但我仍然得到相同的结果。在我用 clang 编译然后执行后,make hello它说 make: 'hello' 是最新的。我知道这听起来很垃圾,但我仍然是新手,正在寻求帮助。提前致谢。