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.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Offline 21,963 posts
since Aug 2005