vc++ multiple file compilation....?

Status
Not open for further replies.

rev_eng

Ars Scholae Palatinae
720
i find this kind of strange....

i ran a little test, which runs fine in gcc, but strange things happen in visual. I am wanting to help a friend out with directx, and just installed visual.

For example, say I have a main.cpp which includes testA.h.

testA.h contains a definition to the class testA, but all the member functions of that class are inline, so no need for a implementation file.

I include classA.h in main.cpp, but when I compile it i get this:
unexpected 'class testA ('
which is the constructor...

followed by a few errors for each line saying that types are not defined, etc.

it appears that it is trying to compile my header? wtf?

of course, i can get it work no problem in g++...i am not so good with visual though...what am i doing wrong?
 

echu888

Ars Tribunus Militum
1,667
testA.h contains a definition to the class testA, but all the member functions of that class are inline, so no need for a implementation file.
code:<HR>
Code:
public:
testA();     // this is the line the first error is on
There is no implementation for the constructor. If you're going to keep everything in the header, then this might work instead:
code:<HR>
Code:
public:
testA() {}    // this is the line the first error is on
 
Status
Not open for further replies.