never never include *.cpp files inside othere *.cpp files. The *.cpp files should be compiled separately and both linked together. The header.h file should be included in both *.cpp files
// header.cpp
//
// system includes
#include <iostream>
// local includes
#include "header.h"
// header implmentation code
//
// blaba
// main.cpp
// header.cpp
//
// system includes
#include <iostream>
// local includes
#include "header.h"
int main()
{
// blabla
}
now depending on the compiler you should have a project that includes both *.cpp files and links them both along with other system libraries to produce the final executable program.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314