error C2601: local function definitions are illegal怎么解决?在线等 创建AppWizard(exe)后,在Proc.h中自定义的函数和Proc.cpp中总是出现上述错误,请教该怎么解决? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 程序如下:// filename Proc.h#ifndef _INC_PROC#define _INC_PROC#include "dibapi.h"#endif //!_INC_DIBAPI#include "dibapi.h"#include <math.h>#include <complex> using namespace std; #define PI (double) 3.14159265359void FHT(complex<double> *TD,complex<double> *FD,int power){ int count; int i,j,k,bfsize,p; double a; complex<double> *W,*X1,*X2,*X; count=1<<power; W=new complex<double>[count/2]; X1=new complex<double>[count]; X2=new complex<double>[count]; for(i=0;i<count/2;i++){ a=-i*PI*2/count; W[i]=cos(a)+sin(a);}memcpy(X1,TD,sizeof(complex<double>)*count);for(k=0;k<power;k++){ for(j=0;j<1<<k;j++) { bfsize=1<<(power-k); for(i=0;i<bfsize/2;i++) { p=j*bfsize; X2[i+p]=X1[i+p]+X1[i+p+bfsize/2]; X2[i+p+bfsize/2]=(X1[i+p]-X1[i+p+bfsize/2])*W[i*(1<<k)]; } } X=X1; X1=X2; X2=X;}for(j=0;j<count;j++){ p=0; for(i=0;i<power;i++) { if(j&(1<<i)) { p+=1<<(power-i-1); } FD[j]=X1[p]; } free(W); free(X1); free(X2);}#define Point(x,y) lpPoints[(x)+(y)*nWidth]void GetPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints){ int x,y,p; int nByteWidth=WIDTHBYTES(nWidth*8); for(y=0;y<nHeight;y++) { for(x=0;x<nWidth;x++) { p=3*x+y*nByteWidth; lpPoints[x+y*nWidth]=(BYTE)(0.299*(float)lpBits[p+2]+0.587*(float)lpBits[p+1]+0.144*(float)lpBits[p]+0.1); } }}void PutPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints){ int x,y,p,p1; int nByteWidth=WIDTHBYTES(nWidth*8); for(y=0;y<nHeight;y++) { for(x=0;x<nWidth;x++) { p=3*x+y*nByteWidth; p1=x+y*nWidth; lpBits[p]=lpPoints[p1]; lpBits[p+1]=lpPoints[p1]; lpBits[p+2]=lpPoints[p1]; } }}Compiling...Proc.cppc:\documents and settings\gg\桌面\数字图像处理\mip2.0\mip2_0\proc.h(62) : error C2601: 'GetPoints' : local function definitions are illegalc:\documents and settings\gg\桌面\数字图像处理\mip2.0\mip2_0\proc.h(75) : error C2601: 'PutPoints' : local function definitions are illegalC:\Documents and Settings\gg\桌面\数字图像处理\mip2.0\mip2_0\Proc.cpp(10) : error C2601: 'ProcFunc' : local function definitions are illegalC:\Documents and Settings\gg\桌面\数字图像处理\mip2.0\mip2_0\Proc.cpp(126) : fatal error C1004: unexpected end of file found执行 cl.exe 时出错.mip.exe - 1 error(s), 0 warning(s) 界面刷新问题 一个奇怪的问题 请教一个动态库和静态库的问题,多多给分阿,请大虾指导阿 版主:木有人回我贴我该怎样结贴啊??? 我的工程怎么老是变成只读属性? DELPHI转C++日志 高手帮忙啊?看看这个代码怎么实现? 问题很容易,一定给分!! 如何获得DLL中的函数及输入,输出参数 求助关于列表视图数据类型转换的! 用CRichEditView怎样才能让关键字显示不同颜色 Google股价持续上涨
// filename Proc.h
#ifndef _INC_PROC
#define _INC_PROC#include "dibapi.h"#endif //!_INC_DIBAPI#include "dibapi.h"
#include <math.h>
#include <complex>
using namespace std;
#define PI (double) 3.14159265359
void FHT(complex<double> *TD,complex<double> *FD,int power)
{
int count;
int i,j,k,bfsize,p;
double a;
complex<double> *W,*X1,*X2,*X;
count=1<<power;
W=new complex<double>[count/2];
X1=new complex<double>[count];
X2=new complex<double>[count];
for(i=0;i<count/2;i++)
{
a=-i*PI*2/count;
W[i]=cos(a)+sin(a);
}
memcpy(X1,TD,sizeof(complex<double>)*count);
for(k=0;k<power;k++)
{
for(j=0;j<1<<k;j++)
{
bfsize=1<<(power-k);
for(i=0;i<bfsize/2;i++)
{
p=j*bfsize;
X2[i+p]=X1[i+p]+X1[i+p+bfsize/2];
X2[i+p+bfsize/2]=(X1[i+p]-X1[i+p+bfsize/2])*W[i*(1<<k)];
}
}
X=X1;
X1=X2;
X2=X;
}
for(j=0;j<count;j++)
{
p=0;
for(i=0;i<power;i++)
{
if(j&(1<<i))
{
p+=1<<(power-i-1);
}
FD[j]=X1[p];
}
free(W);
free(X1);
free(X2);
}
#define Point(x,y) lpPoints[(x)+(y)*nWidth]
void GetPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints)
{
int x,y,p;
int nByteWidth=WIDTHBYTES(nWidth*8);
for(y=0;y<nHeight;y++)
{
for(x=0;x<nWidth;x++)
{
p=3*x+y*nByteWidth;
lpPoints[x+y*nWidth]=(BYTE)(0.299*(float)lpBits[p+2]+0.587*(float)lpBits[p+1]+0.144*(float)lpBits[p]+0.1);
}
}
}
void PutPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints)
{
int x,y,p,p1;
int nByteWidth=WIDTHBYTES(nWidth*8);
for(y=0;y<nHeight;y++)
{
for(x=0;x<nWidth;x++)
{
p=3*x+y*nByteWidth;
p1=x+y*nWidth;
lpBits[p]=lpPoints[p1];
lpBits[p+1]=lpPoints[p1];
lpBits[p+2]=lpPoints[p1];
}
}
}
Compiling...
Proc.cpp
c:\documents and settings\gg\桌面\数字图像处理\mip2.0\mip2_0\proc.h(62) : error C2601: 'GetPoints' : local function definitions are illegal
c:\documents and settings\gg\桌面\数字图像处理\mip2.0\mip2_0\proc.h(75) : error C2601: 'PutPoints' : local function definitions are illegal
C:\Documents and Settings\gg\桌面\数字图像处理\mip2.0\mip2_0\Proc.cpp(10) : error C2601: 'ProcFunc' : local function definitions are illegal
C:\Documents and Settings\gg\桌面\数字图像处理\mip2.0\mip2_0\Proc.cpp(126) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.mip.exe - 1 error(s), 0 warning(s)