使用#include引用的时候,无法顺利引用。
以下为代码:
#include "print.h"
int main(void){
printHello();
return 0;
}
#include <stdio.h>
void printHello(void);
#include "print.h"
void printHello(){
printf("Hello World \n");
}
层级是这样的,请问大家如何解决。
使用#include引用的时候,无法顺利引用。
以下为代码:
#include "print.h"
int main(void){
printHello();
return 0;
}
#include <stdio.h>
void printHello(void);
#include "print.h"
void printHello(){
printf("Hello World \n");
}
层级是这样的,请问大家如何解决。
A2A
Your error is caused by
printHello
in print.h, it should beprintfHello
, so just a typo.You can refer to another my answer here: https://segmentfault.com/q/10...
Update
it seems you write wrong compile commands, try simplest solution: