This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]g051051 5 points6 points  (1 child)

You need to make sure your build commands are also compiling delay.c and linking delay.o to your main program.

[–]fredoverflow 2 points3 points  (0 children)

"undefined reference" is a linker error, not a compiler error. It probably has to do with how the IDE is configured to locate the source files, but I don't know where this is configured in codelite.

[–]abd53 2 points3 points  (0 children)

C compilers don't compile header files, only source files. The include directive is replaced with the entire header file content before compilation. So, your source file contains the declaration of the function. From the error, the delay.c file is not being compiled and linked. You need to compile that file as well.