although this C++ compiler error has been reported many times, I did not find a solution to my problem. I have two files, Foo.hh:
class Serial
{
public:
Serial(int portNumber);
~Serial();
private:
int portNr;
};
and Foo.cc:
#include "Foo.hh"
Serial::Serial(inx portNumber)
{
portNr = portNumber;
}
Serial::~Serial()
{
}
which I try to compile on Linux using
g++ -I. -c -o Foo.o Foo.cc
returning the error
Foo.cc:4:15: error: expected constructor, destructor, or type conversion before ‘(’ token
I do not see any special reason why this should give an error! Any ideas appreciated…
Misspelled
intin the constructor.