一个连接问题!
/*****************************aa.h**********************/
#ifndef AA_H
#define AA_H
#define PI 3.14159
#ifdef _cplusplus
extern "c"
{
#endif
short sum(short x, short y);
#ifdef _cplusplus
};
#endif
#endif
/***************************aa.c*************/
#include "aa.h"
#include "test.h"
short sum(short x, short y)
{
short z;
z = x + y;
return z;
}
/***************test.h**************/
#include <dos.h>
#include <math.h>
#ifndef TEST_H
#define TEST_H
#ifdef _cplusplus
extern "C"
{
#endif
#ifdef _cplusplus
};
#endif
#endif
/************************test.c***********/
#include "test.h"
#include "aa.h"
void main(void)
{
short a, b, c;
a = 100;
b = 456;
c = sum(a, b);
printf("%d\n",c);
}
产生连接错误:undefined symbol:sum....
这是为什么?
thx!