Header (.h) and CPP .(cpp) Help

Oct 20, 2011 at 12:33pm
h1.cpp
using namespace std;
#include "h1.h"
main()
{
}

h1.h
#include "h2.cpp"

h2.cpp
main()
{
}

problem
in the second .cpp (h2.cpp) it will not let me use namespace std even if i add using namespace std; and forced to use std::
Oct 20, 2011 at 1:00pm
Based on the above, this is what h1.cpp looks like when the compiler gets it:

1
2
3
4
5
6
7
8
using namespace std;
main()
{
}

main()
{
}


See any problems?
Oct 20, 2011 at 1:07pm
The compilers probably complaining that main isn't defined or something like that.
you haven't declared what 'main' is.

this might sort out some problems.
Oct 20, 2011 at 1:08pm
Zone, what is the actual error message?
Topic archived. No new replies allowed.