View previous topic :: View next topic |
Author |
Message |
byte_head n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 07 Jun 2007 Posts: 4 Location: Germany
|
Posted: Wed Jun 13, 2007 7:08 pm Post subject: [locale.gen] Schuld an C++ Compiler Fehlern? |
|
|
Hi,
wenn ich versuche eine fehlerfreie C++ Source zu kompilieren, bekomme ich öfter vollkommen abgefahrene Errors.
Bei meinem Kumpel (er hat Ubuntu + xfce auch gcc) geht die selbe Source problemlos.
Er meinte nun es liegt an den Settings die ich in der locale.gen gemacht hätte.
Da ich am liebsten Software auf Englisch nutze, habe ich folgende Einstellungen:
en_US ISO-8859-1
en_US.UTF-8 UTF-8
Allerdings scheint dies wohl falsch zu sein.
Keymap ist auf Deutsch eingestellt etc,
aber ein Bekannter (gut er ist kein Deutscher) hat mir in Jabber einfach geraten es bei diesen
Settings zu belassen "da könne man nichts falschmachen".
Wäre super wenn ihr mir weiterhelfen könntet,
Grüße, byte |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Fauli l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/9342013042b57afb44a90.png)
Joined: 24 Apr 2004 Posts: 760 Location: Moers, Germany
|
Posted: Wed Jun 13, 2007 7:41 pm Post subject: |
|
|
Kannst du mal eine konkrete Fehlermeldung posten? _________________ Do your part to beautify the web! Turn off link underlining! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
dakjo Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/18635768514600eb83f10d8.jpg)
Joined: 31 Jan 2004 Posts: 1544
|
Posted: Thu Jun 14, 2007 7:17 am Post subject: |
|
|
Fauli wrote: | Kannst du mal eine konkrete Fehlermeldung posten? |
Am besten inkl. des Sourcecodes. _________________ 'Dieselben Naturkräfte, die uns ermöglichen, zu den Sternen zu fliegen, versetzen uns auch in die Lage, unseren Stern zu vernichten.' - Wernher von Braun
http://www.mpsna.de |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
byte_head n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 07 Jun 2007 Posts: 4 Location: Germany
|
Posted: Thu Jun 14, 2007 12:51 pm Post subject: |
|
|
Es ist bei vielen Codes so, die ich z.B. mir von einem Freund schicken lasse.
heute meinte er, weil bei mir das whitspace als Zeichen "erkannt" wird vom Compiler kriege ich die ganzen Fehler...
Hier ein einfaches BSP *edit*
Code: |
#include <iostream>
using namespace std;
void doubler(int,int);
int main()
{
cout << " Bitte geben Sie 2 Zahlen ein ! " << endl;
int a;
int b;
cin >> a;
cin >> b;
doubler(a,b);
return 0;
}
void doubler(int a, int b)
{
a=a*2;
b=b*2;
cout<<a<<<endl<<b<<endl;
}
|
johannes@localhost ~ $ gcc test.cpp
test.cpp:9: error: stray '\240' in program
test.cpp:9: error: stray '\240' in program
test.cpp:10: error: stray '\240' in program
test.cpp:10: error: stray '\240' in program
test.cpp:11: error: stray '\240' in program
test.cpp:11: error: stray '\240' in program
test.cpp:12: error: stray '\240' in program
test.cpp:12: error: stray '\240' in program
test.cpp:13: error: stray '\240' in program
test.cpp:13: error: stray '\240' in program
test.cpp:14: error: stray '\240' in program
test.cpp:14: error: stray '\240' in program
test.cpp:14: error: stray '\240' in program
test.cpp:14: error: stray '\240' in program
test.cpp:15: error: stray '\240' in program
test.cpp:15: error: stray '\240' in program
test.cpp:20: error: stray '\240' in program
test.cpp:20: error: stray '\240' in program
test.cpp:20: error: stray '\240' in program
test.cpp:20: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp:21: error: stray '\240' in program
test.cpp: In function 'void doubler(int, int)':
test.cpp:22: error: expected primary-expression before '<' token
test.cpp:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
johannes@localhost ~ $
[/CODE]
mfg, byte |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Fauli l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/9342013042b57afb44a90.png)
Joined: 24 Apr 2004 Posts: 760 Location: Moers, Germany
|
Posted: Thu Jun 14, 2007 5:30 pm Post subject: |
|
|
240 (oktal) = 160 (dezimal) = "Non-breaking space" im ISO-8859-1 Character Set.
Hast du die Quellen vielleicht aus einer HTML-Datei herauskopiert?
Du kannst die nbsp-Zeichen jedenfalls mit sed durch normale Leerzeichen ersetzen (ungetestet): Code: | sed -i 's/\xa0/ /g' test.cpp |
_________________ Do your part to beautify the web! Turn off link underlining! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|