Fehler beim Komplimieren

Linuxneuling

Linuxneuling

Tripel-As
Hallo! Jetzt versuche ich mit C++ unter SuSE 9.1 Programmieren. Ich habe ein Testprogramm mit vi geschrieben bzw. unter /home/username/linux_hallo.cpp abgespeichert. wenn ich g++ -o /home/username/linux_hallo.cpp linux_hallo eingebe bekomme ich folgende Meldung:
linux_hallo.cpp:1: error: parse error before `##' token
linux_hallo.cpp:1: error: parse error before `##' token
linux_hallo.cpp:1: error: syntax error before `.' token
In file included from /usr/include/g++/i586-suse-linux/bits/c++locale.h:42,
from /usr/include/g++/iosfwd:46,
from /usr/include/g++/ios:44,
from /usr/include/g++/ostream:45,
from /usr/include/g++/iostream:45,
from linux_hallo.cpp:2:
/usr/include/langinfo.h:48: error: `__LC_TIME' was not declared in this scope
/usr/include/langinfo.h:48: error: enumerator value for `ABDAY_1' not integer
constant
/usr/include/langinfo.h:241: error: `__LC_COLLATE' was not declared in this
scope
/usr/include/langinfo.h:241: error: enumerator value for `_NL_COLLATE_NRULES'
not integer constant
/usr/include/langinfo.h:265: error: `__LC_CTYPE' was not declared in this scope
/usr/include/langinfo.h:265: error: enumerator value for `_NL_CTYPE_CLASS' not
integer constant
/usr/include/langinfo.h:357: error: `__LC_MONETARY' was not declared in this
scope
/usr/include/langinfo.h:357: error: enumerator value for `__INT_CURR_SYMBOL'
not integer constant
/usr/include/langinfo.h:471: error: `__LC_NUMERIC' was not declared in this
scope
/usr/include/langinfo.h:471: error: enumerator value for `__DECIMAL_POINT' not
integer constant
/usr/include/langinfo.h:492: error: `__LC_MESSAGES' was not declared in this
scope
/usr/include/langinfo.h:492: error: enumerator value for `__YESEXPR' not
integer constant
/usr/include/langinfo.h:507: error: `__LC_PAPER' was not declared in this scope
/usr/include/langinfo.h:507: error: enumerator value for `_NL_PAPER_HEIGHT' not
integer constant
/usr/include/langinfo.h:512: error: `__LC_NAME' was not declared in this scope
/usr/include/langinfo.h:512: error: enumerator value for `_NL_NAME_NAME_FMT'
not integer constant
/usr/include/langinfo.h:521: error: `__LC_ADDRESS' was not declared in this
scope
/usr/include/langinfo.h:521: error: enumerator value for `
_NL_ADDRESS_POSTAL_FMT' not integer constant
/usr/include/langinfo.h:536: error: `__LC_TELEPHONE' was not declared in this
scope
/usr/include/langinfo.h:536: error: enumerator value for `
_NL_TELEPHONE_TEL_INT_FMT' not integer constant
/usr/include/langinfo.h:543: error: `__LC_MEASUREMENT' was not declared in this
scope
/usr/include/langinfo.h:543: error: enumerator value for `
_NL_MEASUREMENT_MEASUREMENT' not integer constant
/usr/include/langinfo.h:547: error: `__LC_IDENTIFICATION' was not declared in
this scope
/usr/include/langinfo.h:547: error: enumerator value for `
_NL_IDENTIFICATION_TITLE' not integer constant

kann mit bitte jemand helfen, was ich falsch gemacht habe.
 
wär toll, wenn du den source mitposten würdest...

edit:

sieht so aus als ob daheader-files fehlen?
 
etuli schrieb:
Boeses Faul.
Sollte heissen "g++ -o linux_hallo /home/username/linux_hallo.cpp"

hilft auch nicht weiter...

Hier die Source:
####linux_hallo.cpp
#include <iostream>
using std::cout;
using std::endl;

int main()
{
cout << "hallo linux!" << endl;
return 0;
}
 
Linuxneuling schrieb:
####linux_hallo.cpp
steht dies wirklich in deinem sourcecode? # kennzeichnen eigentlich praeprozessor-direktiven und ###linuux_hallo.cpp sollte ihn verwirrren (jedenfalls habe ich keine ahnung fuer was dies sein soll) .
lass mal diese zeile weg und versuch es nochmal zu kompilieren.
viele gruesse
andrullo
 
öm es steht doch alles in der fehlermeldung...
ersetze in der ersten zeile die ### mit // wir sind hier nicht unter der bash
 
stimmt, der lattenzaun is kein kommentarzeichen!:)
 
Danke :-)

Jetzt funktioniert es, nachdem ich die Zeile weggelassen habe.

Ich habe eigentlich das erste Mal versucht ein C++ Programm zu schreiben. Ich war einfach neugierig, wie das wirklich unter linux funktioniert und bin auf diesen Thread gestoßen: http://www.unixboard.de/vb3/showthread.php?t=7462. Von dort habe ich den blöde Source...
 

Ähnliche Themen

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Akonadi startet nicht mehr

NagiosGrapher 1.7.1 funktioniert nicht

Samba 4 Gast Zugang unter Ubuntu funktioniert nicht

dovecot und postfix Konfiguration Problem

Zurück
Oben