Ich versuche, diesen einfachen Code in QT Creator auszuführen.QT-Ersteller: Fehler: Symbol (e) nicht für Architektur gefunden 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;
}
Aber ich bekomme immer noch diese zwei Probleme.
Fehler: Symbol (e) nicht für die Architektur x86_64 gefunden
Fehler: Linker Befehl fehlgeschlagen mit Exit-Code 1 (Verwendung -v Aufruf sehen)
Und den vollen Beschreibung, die ich bekomme, ist dies. Inside Compile-Ausgabe.
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.
Ich habe Ihren Code in eine main.cpp eingefügt und es funktioniert hier gut. Ist in Ihrem Fall tatsächlich mehr Code involviert? – E4z9