I have a strange problem when I create a static function in class A and I want to call it from a function of class B. I get
undefined reference to `A :: funcA (int) '
Here is my source code: a.cpp
#include "ah" void funcA(int i) { std::cout << i << std::endl; }
hijras
#ifndef A_H #define A_H #include <iostream> class A { public: A(); static void funcA( int i ); }; #endif // A_H
b.cpp
#include "bh" void B::funcB(){ A::funcA(5); }
and bh
#ifndef B_H #define B_H #include "ah" class B { public: B(); void funcB(); }; #endif
I am compiling with Code :: Blocks.
c ++
xenom
source share