红色为问题所在,在我的电脑上就会出现如下错误: sample8.c - 3 errors 52, 5 Undeclared identifier 'IIRFilterPtr'. 52, 18 syntax error; found 'identifier' expecting ';'. 52, 18 Undeclared identifier 'filter_information'.
去掉52行编译通过,连接又出问题, 1 Project link error Undefined symbol '_FFT' referenced in "sample8.c".
但是,我在另一台机器上就没有问题。可以通过。 是不是因为我们的CVI版本不同,或者是包含的库不同? 怎么解决啊??谢谢啦!!!!!! —————————————————————————————————————————— #include <ansi_c.h> #include <analysis.h> #include <cvirte.h> #include <userint.h> #include "sample8.h" static int panelHandle; #define NUMPOINTS 256 AnalysisLibErrType FFT (double arrayXReal[], double arrayXImg[], int numberOfElements); int main (int argc, char *argv[]) { if (InitCVIRTE (0, argv, 0) == 0) return -1; /* out of memory */ if ((panelHandle = LoadPanel (0, "sample8.uir", PANEL)) < 0) return -1; DisplayPanel (panelHandle); RunUserInterface (); DiscardPanel (panelHandle); return 0; } int CVICALLBACK PanelCallback (int panel, int event, void *callbackData, int eventData1, int eventData2) { switch (event) { case EVENT_GOT_FOCUS: break; case EVENT_LOST_FOCUS: break; case EVENT_CLOSE: QuitUserInterface (0); break; } return 0; } int CVICALLBACK ReplotWaveforms (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { // double wave1Amp,wave2Amp,wave1Circle,wave2Circle; double ripple,attenuation,upper_cutoff_frequency,lower_cutoff_frequency,sample_rate; double waveData1[NUMPOINTS],waveData2[NUMPOINTS],tempData[NUMPOINTS],signalData[NUMPOINTS]; int filter_style,filter_type,filter_order,window_style,use_pulse,i;
// IIRFilterPtr IIRFilterPtr filter_information;
switch (event) { case EVENT_COMMIT: // DeleteGraphPlot(panel,PANEL_FREQGRAPH,-1,VAL_DELAYED_DRAW); DeleteGraphPlot(panel,PANEL_TIMEGRAPH,-1,VAL_DELAYED_DRAW); DeleteGraphPlot(panel,PANEL_WINDOWGRAPH,-1,VAL_DELAYED_DRAW); DeleteGraphPlot(panel,PANEL_FILTERGRAPH,-1,VAL_DELAYED_DRAW);
// GetCtrlVal(panel,PANEL_WAVE1AMP,&wave1Amp); GetCtrlVal(panel,PANEL_WAVE2AMP,&wave2Amp); GetCtrlVal(panel,PANEL_WAVE1CIRCLE,&wave1Circle); GetCtrlVal(panel,PANEL_WAVE2CIRCLE,&wave2Circle);
// SinePattern(NUMPOINTS,wave1Amp,0.0,wave1Circle,waveData1); SinePattern(NUMPOINTS,wave2Amp,0.0,wave2Circle,waveData2);
Add1D(waveData1,waveData2,NUMPOINTS,signalData);
// PlotY(panelHandle,PANEL_TIMEGRAPH,signalData,NUMPOINTS,VAL_DOUBLE,VAL_THIN_LINE,VAL_NO_POINT,VAL_SOLID,1,VAL_RED);
//FFT for(i=0;i<NUMPOINTS;i++) tempData=0;
FFT(signalData,tempData,NUMPOINTS); for(i=0;i<NUMPOINTS;i++) signalData=sqrt(signalData*signalData+tempData*tempData); PlotY(panelHandle,PANEL_FREQGRAPH,signalData,NUMPOINTS/2,VAL_DOUBLE,VAL_THIN_LINE,VAL_NO_POINT,VAL_SOLID,1,VAL_RED);
break; } return 0; } int CVICALLBACK QuitCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2) { switch (event) { case EVENT_COMMIT: break; } return 0; }
|