Things to check

Have you included the .h file where the variable or function is defined as “extern”?

Is the .c file included in CMakeLists.txt?