undefined reference when calling inline function
I am getting a really odd error from GCC 4.8.1 with inline functions. I have two near-identical inline functions defined in header files ( debug.h and error.h ) in src/include/ , with the only difference being what they print - one prefixes DEBUG: to the message, and the other %s: error: %s (program name, error message). When defining the functions both inline, and compiling a debug build (so it sets the macro DEBUG=1 ), I get lots of undefined reference errors: src/main_debug.o gcc -osrc/main_debug.o src/main.c -c -Wall -Wextra -Wpedantic -std=gnu11 -march=native -Og -g -DCC="\"gcc\""