when you create functions in different files, it's a good idea to DECLARE the function prototype in a header file, and DEFINE the function in a CPP. Only include header files.
eg:
Code:
main.cpp---
#include "myheader.h"
int main(void)
{
MyFunc();
return(0);
}
myheader.h---
#ifndef MYHEADER_H
#define MYHEADER_H
int MyFunc(void);
#endif // MYHEADER_H
myheader.cpp---
#include "myheader.h"
#include <iostream>
using namespace std;
int MyFunc(void)
{
cout << "MyFunc\n";
return(1);
}
doing this will prevent you from having problems with things being defined multiple times. The only functions that you should define a body for in header files are inline functions.
hope this helps
U.