-
Error Msg
I have been going through the search and I am still stuck...I keep getting "cannot create pre-compiled header: code in header"
I read that it means as it says but I dont know what to do about it. Someone pls, pls tell me how I go about getting rid of this error. I have 4 .h files and 2 .cpp files.
Code:
.h files and their includes
bstree -> #include "btnode.h"
dictionary -> #include "btnode.h"
#include "bstree.h"
#include "mystring.h"
.cpp files and their includes
main -> #include "dictionary.h"
dictionary - > #include "dictionary.h"
NB:
I am using borland.
Thanx
-
> cannot create pre-compiled header: code in header
It means you have code inside the header file
Code:
void foo ( void ) {
cout << "hello";
}
What you should have in the header is only
void foo ( void );
And put the actual code in a .cpp file.
-
I do...but they are templates. This has not caused any problems before.
-
If Borland doesn't support templates in precompiled headers then you either have to stop using precompiled headers or stop using Borland, as I don't think you want to stop using templates.
-
I dont get what a precompiled header is :confused: Maybe someone could tell me, so as I might be able to try and solve this problem.