error: stray '\xyz' in program

Gregor Schatz <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,

ich bekomme beim übersetzen eines C++ Beispieles aus einem Buch eine 
riesenlange fehlermeldung und kann sie nicht einordnen/erklären. 
Es scheint an der eingebundenen include Datei <list> zu liegen, die hab ich 
mir aber angeschaut (/usr/include/g++/list) und da kann ich auch nichts 
besonderes feststellen.

Die Fehlermeldung(en) fängt/fangen so an:
In file included from pointer.cpp:2:
list:1: error: stray '\177' in program
list:1: error: stray '\1' in program
list:1: error: stray '\1' in program
list:1: error: stray '\1' in program
In file included from pointer.cpp:2:
list:1:8: Warnung: null character(s) ignored
list:1: error: stray '\2' in program
list:1:18: Warnung: null character(s) ignored
list:1: error: stray '\3' in program
list:1:20: Warnung: null character(s) ignored
list:1: error: stray '\1' in program
list:1:22: Warnung: null character(s) ignored
list:1: error: parse error before `@' token
list:1: error: stray '\211' in program
list:1: error: stray '\4' in program
list:1: error: stray '\10' in program
[...]
und enden so:
list:231:2737: Warnung: null character(s) ignored
list:231: error: parse error before `@' token
list:231: error: parse error before `@' token
list:231:2774: Warnung: null character(s) ignored
list:231:2789: Warnung: null character(s) ignored
list:231:2789: Warnung: no newline at end of file
pointer.cpp:18: error: parse error before `}' token
pointer.cpp: In function `int main(int, char**)':
pointer.cpp:22: error: `Sprite' undeclared (first use this function)
pointer.cpp:22: error: (Each undeclared identifier is reported only once for 
   each function it appears in.)
pointer.cpp:24: error: `list' undeclared (first use this function)
pointer.cpp:24: error: `sprList' undeclared (first use this function)
make: *** [pointer.o] Fehler 1
.
Wenn ich den include rausnehme ist die Fehlerliste weg, ich kann aber keine 
liste erzeugen.
pointer.cpp sieht so aus:
--------
#include <iostream>
#include <list>
// Eine Struktur für eine
// animierte Spielgrafik
struct Sprite{
    float  x,  y;
    float dx, dy;    
    int   frameCount;
    int   animationCount;
    int   **animation;
    int   curAnimation;
    int   curFrame;
    void  *frames;
};
int main(int, char**) {  
    std::cout << sizeof(Sprite);
    list<Sprite> sprList;
    return 0;
}
-------
Benutzer gcc: 3.3.1
Meine frage ist die headerdatei kaputt?
Woran könnte es liegen?

Vielen dank für Hilfe

schöne Gruße 

Gregor


-- 
Um die Liste abzubestellen, schicken Sie eine Mail an:
    [email protected]
Um eine Liste aller verfügbaren Kommandos zu bekommen, schicken
Sie eine Mail an: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.