我有一個神祕的問題! 在main.c中我有以下幾點:CC編譯器中未定義的函數(minix)
#include "jogo.h"
int main(){
int i;
sef_startup();
vg_init(0x105);
batalha_naval();
sleep(5);
vg_exit();
return 0;
}
在jogo.h我:
#ifndef __JOGO_H
#define __JOGO_H
void batalha_naval(void);
#endif
而在main.c中我有:
#include "core.h"
void batalha_naval(void) {
vg_draw_line(0, 0, 1023, 0, 12);
}
但當做一個make時,編譯器會在main.c中給出一個undefined _batalha_naval();
。如果我在jogo.h中定義函數,則不會出現錯誤,但如果我這樣做,則會顯示錯誤。
我正在使用CC編譯器。
向我們展示您正在使用的編譯命令。 – AusCBloke
core.h中是什麼? – Hogan