高手帮忙看看:
test_f.h 文件
#ifndef _H_H
#define _H_H
extern int k;//k为偏移量数组中的计数变量
extern int in_tab[9999]={0};
extern float coef_tab[9999]={0};
extern float out_tab[9999]={0};
extern int io[256];
extern int co[256];
extern int oo[256];
extern void init_alg(char *p_buf);
extern int two_one(char a,char b);
extern struct rbn
{
int blk_num;//block number
int fun_num;//function code number
int MFP;//MFP number
int seq_blk;// initial sequence
int in_num;//input number
int coef_num;// coeffcient number
int out_num;// output number
int *in_offet;//input offset
float *coef_offet;//coeffcient offset
float *out_offet;//output offset
int *in;
float *coef;
float *out;
float dt;//compute periods
}init_rbn[10000];
#endif
test_f.cpp文件
#include <stdlib.h>
#include <stdio.h>
#include "test_f.h"
#include "math.h"
#include <iostream.h>
int two_one(char a,char b)
{
int blk_n;
blk_n = ((unsigned char)a <<8)|(unsigned char)b;
return(blk_n);
}
int io[256]={0,1,0,2,2,1,1,1,2,3,4,
4,1,3,4,2,2,2,3,4,3,
6,6,6,1,0,0
};
int co[256]={0,12,1,2,4,2,2,1,2,2,0,
0, 2,0,0,2,1,1,7,8,1,
10,10,10,2,2,3
};
int oo[256]={0,1,1,1,2,1,1,1,1,1,1,
1,2,1,1,1,1,1,1,1,1,
6,6,6,1,1
};
void init_alg(char *p_buf)
{
init_rbn[0].in_offet=&in_tab[0];
init_rbn[0].coef_offet=&coef_tab[0];
init_rbn[0].out_offet=&out_tab[0];
init_rbn[k].blk_num=two_one(p_buf[28],p_buf[29]);
}
int main()
{
int *p=&in_tab[0];
printf("*p=\n",*p);
return 0;
}
Configuration: test_f - Win32 Debug--------------------
Compiling...
test_f.cpp
Linking...
test_f.obj : error LNK2001: unresolved external symbol "int k" (?k@@3HA)
test_f.obj : error LNK2001: unresolved external symbol "struct rbn * init_rbn" (?init_rbn@@3PAUrbn@@A)
Debug/test_f.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
test_f.exe - 3 error(s), 0 warning(s)
在线等