引用问题
请高手点拨~~~连接时候发生错误说我Print()函数没定义~~~我的extern用的也没错吧? 请高手指点~~谢谢// main.c
#include <stdio.h>
#Include "main.h"
#include "main2.h"
int gl; // 自动被初始化为0
int main()
{
int location = 1;
Print();
}
//main.h
#ifndef __MAIN_H__
#define __MAIN_H__
void Print();
#endif
// main2.c
void Print()
{
extern int gl;
extern int location;
printf("gl = %d \n location = %d", gl, location);
}
//main2.h
#include "main.h"
[此贴子已经被作者于2006-12-4 20:36:29编辑过]