I am currently starting work on a project where i would have a file of shared tool functions which i can use without having to instance the class, i have read about using static functions for this so i decided to try to do the same. However i seem to keep getting an error of undefined reference to my static function. Looking for an answer I came upon several answers like the one in the following link but i still fail to compile my code: undefined reference to a static function
I decided to copy and paste the code given in the link above, a.cpp/.h and b.cpp/.h files, but even then i get compilation errors: undefined reference to main [this error i can remove by adding a simple main function in b.cpp] undefined reference to A::funcA(int)
Am i forgeting something when compiling? I am simply using g++ b.cpp am using g++ 4.7.2.
Thanks in advance.