【发布时间】:2022-12-16 01:49:06
【问题描述】:
我是 C++ 的新手,正在尝试使用 get_string,但我不确定我写错了什么导致了错误。
我的代码如下:
#include <stdio.h>
#include <cs50.h>
int main(void)
{
string name = get_string("What's your name? ");
printf("hello, %s\n", name);
}
它一直说以下错误:
Undefined symbols for architecture arm64:
"_get_string", referenced from:
_main in hello-890d43.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [hello] Error 1
有谁知道我做错了什么?
我希望代码接受输入并打印出你好,(你的输入)。
【问题讨论】:
-
请在本网站搜索
c++ Undefined symbols for architecture arm64:。这个问题已经在这里被问过和回答过好几次了。请总是在发布新问题之前彻底搜索网站。 -
cs50 不是 C 而不是 C++ 吗?