Dear my friends..
I am practicing GNU C++ on SuSE 9.1.
But if I compile my code I got this error message as
below:
====
patrixlinux@patrix:~/arsip/proyek/gcc/liss> g++ -o
liss ./liss.cpp
In file included from
/usr/include/g++/backward/iostream.h:31,
from liss.cpp:1:
/usr/include/g++/backward/backward_warning.h:32:2:
warning: #warning This file includes at least one
deprecated or antiquated header. Please consider using
one of the 32 headers found in section 17.4.1.2 of the
C++ standard. Examples include substituting the <X>
header for the header for C++ includes, or
<sstream> instead of the deprecated header
. To disable this warning use
-Wno-deprecated.
liss.cpp: In member function `void menu::tampil()':
liss.cpp:19: error: `samba' undeclared (first use this
function)
liss.cpp:19: error: (Each undeclared identifier is
reported only once for each
function it appears in.)
liss.cpp:19: error: `s' undeclared (first use this
function)
liss.cpp:19: error: syntax error before `(' token
liss.cpp: At global scope:
liss.cpp:39: error: `struct samba' used prior to
declaration
patrixlinux@patrix:~/arsip/proyek/gcc/liss>
====
Why is it so?
Thank you very much in advance.
ps.Sorry for my stupid question.
====
Here is my code.
====
#include
#include
#include
class menu {
public:
char pilihan;
void tampil();
};
void menu::tampil(){
for (;;){
cout << "Menu : (S)amba (P)ostfix (B)ind (Q)uit\n";
cin >> pilihan;
switch ( toupper(pilihan) ){
case 'S':
cout << "You are administrating Samba Server" << endl;
samba * s = new samba();
s->tampil();
break;
case 'P':
cout << "You are administrating Postfix Server" <<
endl;
break;
case 'B':
cout << "You are administrating BIND Server" << endl;
break;
case 'Q':
cout << "You selected Quit. Good bye!" << endl;
exit(0);
default:
cout << "***No such command!***" << endl;
break;
}
}
}
class samba {
public:
char resource[50];
void tampil();
};
void samba::tampil(){
for(;;){
cout << "Share file or directory: ";
cin >> resource;
}
}
int main(){
menu * m = new menu();
m->tampil();
return 0;
}
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail