The cause of the error is that the compiler is unable to locate the gobjects.h
header file. This file resides in the spl/include
folder.
The other programs, such as label
and breakout
, can be compiled because the makefile instructions for the compiler (actually the pre-processor) on where to locate the .h
files. You can see this working when you run make label
, the command that executes is:
clang -ggdb -Ispl/include -O0 -std=c99 -Wall -Werror -o label label.c -Lspl/lib -lcs -lm
The relevant parts here are:
-Ispl/include
: Inform the pre-processor on where to look for additional .h
files, including gobjects.h
.
-Lspl/lib
: Instructs the linker to link in the spell binary code.
Notice that when you run make labelTest1
, the above are not included, and so the pre-processor and the linker have no way of knowing where to find the relevant SPL headers and library file.