Forum
Fehlermeldung in Microsoft Visual Studio 2010 (Computertechnik)
Hallo an die Gemeinde.
Diese Frage setzt voraus, dass sich jemand mit C++ Programmierung in Microsoft Visual Studio 2010 auskennt.
Ich wollte ein Programm schreiben, das den Unterschied zwischen globalen und lokalen Variablen darstellt.
Dazu folgender Quellcode:
----------------------------------------------------------
#include
using namespace std;
void myFunction(); // Funktionsprototyp
int x = 5, y = 7; // globale Variablen
int main ()
{
cout << "x von main: " << x << "n!";
cout << "y von main: " << y << "n!";
myFunction();
cout << "Zurück aus myFunction!nn!";
cout << "x von main: " << x << "n!";
cout << "y von main: " << y << "n!";
return 0;
}
void myFuction()
{
int y = 10;
cout << "x von myFuntion: " << x << "n!";
cout << "y von myFuction: " << y << "n!";
}
----------------------------------------------------------
Kompilieren geht noch, heißt, beim Kompilieren wird kein Fehler angezeigt.
Wenn ich jedoch "starten ohne Debugging" anklicke, kommt folgende Fehlermeldung:
1> Alle Ausgaben sind aktuell.
1> Globale und lokale Variablen.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl myFunction(void)" (?myFunction@@YAXXZ)" in Funktion "_main".
1> 1>D:ProgrammdateienMicrosoft Visual Studio 2010CPP ProgrammierungDebugListing 5.3 - Globale und lokale Variablen.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
Soweit ich das verstanden habe, werden gewisse Bibliotheken nicht gefunden.
Hat jemand einen Tipp?
Danke im Voraus.
Gruß
Max
--
Where is the madness ...
Gesamter Thread:

