Dromar
February 26th, 2010, 02:44 PM
Hi everybody,
I'm new at programming with Linux, so I wanted to make a very simple application with a class. I looks something like this:
//file: main.cpp
#include <stdio.h>
void main(){
readbugs *rb = new readbugs();
return;
}
// file: readbugs.h
#pragma once
#include <stdio.h>
class readbugs{
readbugs();
~readbugs();
};
// file: readbugs.cpp
#include "readbugs.h"
readbugs::readbugs(){ }
readbugs::~readbugs(){ }
As you see it's as simple as possible, but still when I want to compile it with:
qmake -project main.cpp; qmake; make
I get the following error:
In file included From readbug.cpp:2:
readbug.h:3: error: expected constructor, destructor, or type conversion before ';'
token
Can you please, tell me what I'm missing, or maybe recommend me another compiler than the QT compiler. (Please not a whole development environment, cause I want to program with the command line :P)
thx for your help
I'm new at programming with Linux, so I wanted to make a very simple application with a class. I looks something like this:
//file: main.cpp
#include <stdio.h>
void main(){
readbugs *rb = new readbugs();
return;
}
// file: readbugs.h
#pragma once
#include <stdio.h>
class readbugs{
readbugs();
~readbugs();
};
// file: readbugs.cpp
#include "readbugs.h"
readbugs::readbugs(){ }
readbugs::~readbugs(){ }
As you see it's as simple as possible, but still when I want to compile it with:
qmake -project main.cpp; qmake; make
I get the following error:
In file included From readbug.cpp:2:
readbug.h:3: error: expected constructor, destructor, or type conversion before ';'
token
Can you please, tell me what I'm missing, or maybe recommend me another compiler than the QT compiler. (Please not a whole development environment, cause I want to program with the command line :P)
thx for your help