gpt4 book ai didi

c - CS50 第 1 周类(class)中的未定义引用

转载 作者:太空宇宙 更新时间:2023-11-04 07:44:52 24 4
gpt4 key购买 nike

<分区>

我注册了 CS50。我正在做第 1 周的项目。程序顶部的#include 应该已经定义了某些程序,例如 get_string、get_int 等...在我进入项目之前,我运行了一个简单的测试以确保一切正常。

#include <cs50.h>
#include <stdio.h>

int main(void)
{
printf("What is your name?\n");
string x = get_string("x");
printf("Hello, %x!");
}

我的代码在上面,下面是我不断收到的错误。

undefined reference to `get_string'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

当我输入 #include 时,这些错误不是已经被引用了吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com