0

I have three files: main.c, location.c and location.h. They can't seem to compile.

Here are my source files. main.c:

#include <stdio.h>
#include "location.h"

int main() {
    executeLook();
    return 0;
}

location.c:

#include <stdio.h>

void executeLook() {
    print("Hello World");
}

location.h:

extern void executeLook();

On compiling the CodeBlocks(gcc compiler) compiler gives the following error:

c:\mingw\bin\..\lib\gcc\mingw32\8.2.0\..\..\..\..\mingw32\bin\ld.exe: I:\Test Program\main.o: main.c|| undefined reference to `executeLook'|

Anyone able to help me out? I'm really stuck on this.

m_azami
  • 1
  • 1
  • Actually, that dupe is a C++ question, although the principles still apply. A better C dupe is here: https://stackoverflow.com/q/5892056/10077 – Fred Larson Mar 24 '20 at 14:35
  • Unfortunately, "compiling" is an overloaded term used to describe the complete build process. The error you are seeing is not a compiler error at all. – William Pursell Mar 24 '20 at 14:40

0 Answers0