Say I have a header file, a.h
Code:
#ifndef A_H
#define A_H

int some_util_function() {
...
}

#endif
and b.cpp, c.cpp, both needs to use this function.

If I compile them separately then link them, I get a multiple definitions error.

Code:
gcc -c b.cpp
gcc -c c.cpp
gcc b.o c.o #multiple definitions
What's the standard way to fix this? (Except moving it to another .c)