Home » Language IDEs » C / C++ IDE (CDT) » Errors in conio.h ?
Errors in conio.h ? [message #153886] |
Tue, 13 September 2005 15:06 |
Eclipse User |
|
|
|
Originally posted by: asser.fahrenholz.dk
Hello :) I dont know, maybe I can find help here... I've coded the following
program (nevermind if it works or not...):
------------------------------------------------------------ -------------
#include <iostream.h>
#include <e:/cygwin/usr/include/mingw/conio.h>
using namespace std;
class tollBooth{
private : int cars;
double collected;
public : void payingCar(){
cars++;
collected += .50;
}
Initialise() : cars(0), collected(0) { }
void nopayCar(){
cars++;
}
void display(){
cout << "Number of total cars: " << cars << "\n";
cout << "Collected toll: " << collected;
};
}
int main(){
Initialise cars, collected;
cars = 0;
collected = 0.0;
int quit = 0;
char choice = 'a';
while(true){
cout << "Press Esc (display and exit), c (non paying car) or p (paying car):
";
choice = getche();
while(dir != 'd'){
switch(dir){
case 'c' : nopayCar(); break;
case 'p' : payingCar(); break;
default : cout << "Try again\n";
}
}
}
return 0;
}
------------------------------------------------------------ ------------------------------------------
And I recieve the following errors when compiling - as far as I can see -
there's a problem with conio.h
------------------------------------------------------------ -----------------------------------------
**** Full rebuild of configuration Debug for project 6point2 ****
make -k clean all
rm -rf ./6point2.o ./6point2.d 6point2.exe
Building file: ../6point2.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o6point2.o ../6point2.cpp
In file included from
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/iostr eam.h:31,
from ../6point2.cpp:1:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward/backw ard_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 <X.h> header for C++ includes, or <iostream> instead of the
deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from ../6point2.cpp:2:
e:/cygwin/usr/include/mingw/conio.h:16:20: _mingw.h: No such file or
directory
In file included from ../6point2.cpp:2:
e:/cygwin/usr/include/mingw/conio.h:24: error: expected constructor,
destructor, or type conversion before "char"
e:/cygwin/usr/include/mingw/conio.h:24: error: expected `,' or `;' before
"char"
e:/cygwin/usr/include/mingw/conio.h:25: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:25: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:26: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:26: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:27: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:27: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:29: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:29: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:30: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:30: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:31: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:31: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:32: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:32: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:33: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:33: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:38: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:38: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:39: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:39: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:40: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:40: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:41: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:41: error: expected `,' or `;' before
"int"
e:/cygwin/usr/include/mingw/conio.h:42: error: expected constructor,
destructor, or type conversion before "int"
e:/cygwin/usr/include/mingw/conio.h:42: error: expected `,' or `;' before
"int"
.../6point2.cpp:14: error: ISO C++ forbids declaration of `Initialise' with
no type
.../6point2.cpp: In member function `int tollBooth::Initialise()':
.../6point2.cpp:14: error: only constructors take base initializers
.../6point2.cpp:14: warning: no return statement in function returning
non-void
.../6point2.cpp: At global scope:
.../6point2.cpp:26: error: new types may not be defined in a return type
.../6point2.cpp:26: error: extraneous `int' ignored
.../6point2.cpp:26: error: `main' must return `int'
.../6point2.cpp:26: error: return type for `main' changed to `int'
.../6point2.cpp: In function `int main(...)':
.../6point2.cpp:27: error: `Initialise' undeclared (first use this function)
.../6point2.cpp:27: error: (Each undeclared identifier is reported only once
for each function it appears in.)
.../6point2.cpp:27: error: expected `;' before "cars"
.../6point2.cpp:28: error: `cars' undeclared (first use this function)
.../6point2.cpp:29: error: `collected' undeclared (first use this function)
.../6point2.cpp:34: error: `getche' undeclared (first use this function)
.../6point2.cpp:35: error: `dir' undeclared (first use this function)
.../6point2.cpp:37: error: `nopayCar' undeclared (first use this function)
.../6point2.cpp:38: error: `payingCar' undeclared (first use this function)
.../6point2.cpp:30: warning: unused variable 'quit'
make: *** [6point2.o] Error 1
make: Target `all' not remade because of errors.
Build complete for project 6point2
------------------------------------------------------------ --------------------------------
Anyone know what's up with this ? I've tried re-installing the Devel-package
in Cygwin, but it didn't seem to help...
-Regards, Asser
|
|
|
Goto Forum:
Current Time: Sun Jul 27 06:23:40 EDT 2025
Powered by FUDForum. Page generated in 0.04513 seconds
|