I have a suite of helper functions defined in testhelper.c To facilitate their use I am trying to link them to a header file, testhelper.h and include this file in the testing programs I am developing. However, the files are not linking correctly, because I am getting an "undefined reference to " in the testing programs when they compile.
The code in the makefile is:
randomtestadventurer: randomtestadventurer.c dominion.o rngs.o testhelpers.o
gcc -o randomtestadventurer -g randomtestadventurer.c dominion.o rngs.o $(CFLAGS)
randomtestcard: randomtestcard.c dominion.o rngs.o testhelpers.o
gcc -o randomtestcard -g randomtestcard.c dominion.o rngs.o $(CFLAGS)
testhelpers.o: testhelpers.h testhelpers.c
gcc -c testhelpers.c -g $(CFLAGS)
The include path in both of the randomtest programs is: #include "testhelpers.h"
This is my first attempt at a header file I've made from scratch, so I am not certain what I have done wrong.