使用c头文件时出现“未定义引用”错误

时间:2020-03-24 14:31:02

标签: c gcc header-files undefined-reference

我有三个文件:const ans = Math.ceil((len - start) / (frequency - 1)) main.clocation.c。他们似乎无法编译。

这是我的源文件。 main.c:

location.h

location.c:

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

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

location.h:

#include <stdio.h>

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

在编译CodeBlocks(gcc编译器)编译器时,出现以下错误:

extern void executeLook();

有人能帮助我吗?我真的很坚持。

0 个答案:

没有答案