HILFE !!! was not declared in this scope
-
Hallo,
ich habe folgendes Problem
matrix.cpp:
#include <iostream> using namespace std; int main() { test(); return 0; }; void test() { cout << "Hello"<< endl; }wenn ich es kompiliere, bekomme ich:
../matrix.cpp: In function ‘int main()’:
../matrix.cpp:22: error: ‘test’ was not declared in this scope
../matrix.cpp: In function ‘double det(double**, int)’:
../matrix.cpp:110: warning: suggest parentheses around assignment used as truth value
../matrix.cpp:114: warning: suggest parentheses around assignment used as truth value
make: *** [matrix.o] Error 1kann jemand helfen?
was mache ich falsch?danke...
-
Zum Zeitpunkt des Aufrufs in main() ist die Funktion test() nicht bekannt. Diese musst du vorher durch einen Funktionsprototypen deklarieren:
#include <iostream> using namespace std; void test(); // Funktionsprototyp int main() { test(); return 0; }; void test() { cout << "Hello"<< endl; }Das sollte den ersten Fehler beheben. Für die anderen fehlt entsprechender Code.
Grüße... Heiko
-
Bestes Dank...
Es hat geklappt.
oder die main-Funktion soll am Ende der Code plaziert werden , dann klappt es auch.DANKE........................................

-
mh
ich würde das komma am ende der main funktion entfernen...