Hi Leute,
hab ein Problem mit der SFML.
Hab mir ne Funktion.hpp und Funktion.cpp geschrieben.
Wenn ich nun in der main Funkktion.hpp include sagt der mit er will en ;.
Funktion.hpp:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
|
#ifndef FUNKTION
#define FUNKTION
#include<String>
int Error(const std::string&);
#endif
|
Funktion.cpp:
|
C-/C++-Quelltext
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include <iostream>
#include <SFML\Graphics.hpp>
#include "Funktion.hpp"
int Error(const std::string&)
{
sf::RenderWindow Error(sf::VideoMode(250,150,32),"Error 104!");
while(Error.IsOpened())
{
sf::Event Error1;
while(Error.GetEvent(Error1))
{
if(Error1.Type == sf::Event::Closed)
Error.Close();
}
sf::Font Fail;
if(!Fail.LoadFromFile("arial.ttf"))
{
}
sf::String Fehlermeldung("Bild wurde nicht gefunden",Fail,16);
Fehlermeldung.SetColor(sf::Color(0,0,0));
Fehlermeldung.SetX(30);
Fehlermeldung.SetY(60);
Error.Clear(sf::Color(255,255,255));
Error.Draw(Fehlermeldung);
Error.Display();
}
return EXIT_FAILURE;
}
|
Hier noch den anfang der main:
|
C-/C++-Quelltext
|
1
2
3
4
5
|
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Funktion.hpp"
int main()
|
die fehlermeldung ist folgende:
1>------ Erstellen gestartet: Projekt: SFMLProjekt, Konfiguration: Debug Win32 ------
1>Der Buildvorgang wurde am 26.02.2011 11:05:13 gestartet.
1>InitializeBuildStatus:
1> Aktualisieren des Timestamps von "Debug\SFMLProjekt.unsuccessfulbuild".
1>ClCompile:
1> main.cpp
1>c:\users\moritz\documents\visual studio 2010\projects\sfmlprojekt\sfmlprojekt\src\main.cpp(6): error C2144: Syntaxfehler: 'int' sollte auf ';' folgen
1>
1>Fehler beim Erstellen
1>
1>Verstrichene Zeit 00:00:01.07
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========
Hoffe ihr könnt mir helfen.
Gruß
MoWee