"main.h"??? <-- Obviously something wrong here.
If I want to use testfunction from main it brings an error that no such function exists. But I am sure that testfunction.cpp is also getting compiled because if I add an error there I will get an compile error.
Well, if there's something that won't compile, the compiler won't get to anything else after that error.
Be sure to use this with all your source files:
Code:
#ifndef _MYSOURCEFILENAME_H
#define _MYSOURCEFILENAME_H
/* Your source file */
#endif
*make* files would teach you a good way of keeping track of dependencies...
Basically:
wherever main is needs (#include "testfunction.cpp")
testfunction.cpp needs(#include "testfunction.h")
testfunction.h needs no other dependencies.