我想在QT Creator中运行这个简单的代码。QT创建者:错误:找不到架构x86_64的符号
#include<iostream>
using namespace std;
const int SENTINEL = 0;
int main() {
cout<<"This program adds a list of numbers "<<endl;
cout<<"Use "<<SENTINEL<<" to signal the end."<<endl;
int total = 0;
while(true) {
int value;
cout<<" ? ";
cin>>value;
if(value == SENTINEL) break;
total += value;
}
cout<<"The total is "<<total<<endl;
return 0;
}
但我一直在解决这两个问题。
错误:符号(S)没有发现建筑x86_64的
错误:连接命令,退出代码为1(使用-v看看调用)
并全面失败我得到的描述是这样的。内部编译输出。
Undefined symbols for architecture x86_64: "Main()", referenced from: Main(int, char**) in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [simple-project.app/Contents/MacOS/simple-project] Error 1 00:04:36: The process "/usr/bin/make" exited with code 2. Error while building/deploying project simple-project (kit: Desktop Qt 5.7.0 clang 64bit) When executing step "Make" 00:04:36: Elapsed time: 00:27.
我把你的代码粘贴到main.cpp中,它在这里工作的很好。实际上你的案例涉及更多的代码? – E4z9