VS 2008 LNK 2028错误 [英] VS 2008 LNK 2028 errors

查看:101
本文介绍了VS 2008 LNK 2028错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi


刚开始使用VS2008 C ++



我正在尝试从旧的C ++项目编译代码进入Windows窗体项目。当我编译时,我得到一个类的几个对象的LNK2028错误。 Class在CLASSES.h文件中声明,但似乎在SIGNAL.cpp文件中未被识别。这是几个典型的错误:



错误1错误LNK2028:未解析的令牌(0A000009)void * __clrcall memrealloc(void * ,unsigned int)(?memrealloc @@ $$ FYMPAXPAXI @ Z)在函数public:int __clrcall Signal :: undo_difference(class Signal *)(?undo_difference @ Signal @@ $$ FQAMHPAV1 @@ Z)SIGNAL中引用。 obj 





这是头文件FUNCDEFS.h中的令牌(我认为!)声明:

 extern void * memrealloc(void * ptr,unsigned int size); 





EXTERN.h中的代码因此:

 extern TDecoratedMDIFrame * frame; 
extern npredictMDIClient * mdiClient;





这是头文件CLASSES.h中的Class声明:



 class Signal {

public:
Signal(char * signame,int length,double * signal);
~Signal();

enum SignalType类型; //优化显示
int n; //信号长度
char * name; //它的名字
double * sig; //这里是
int居中; //它是否居中?
双分; //它的中心如果是这样的
int detrended; //它已经去了吗?
双坡; //斜率,如果是这样的话
double pivot; //和枢轴点
int offsetted; //它被抵消了吗?
双倍; //如果是这样的偏移
int缩放; //它已经缩放了吗?
双倍标准; //其规模如果是这样的话,那么
int标准化; //它已经标准化了吗?
双倍均值; //它的意思是这样的
double std; //和它的标准差
int差异; //它有区别吗? (学位如果是这样的话)
double leads [3]; //差异
int季节性之前的第一个点; //季节性差异吗? (如果是这样的话)
double * sleads; //第一个句点如果是这样的话
int source_n; //如果CORRELATION或SPECTRUM,定义信号的长度
int known_n; //通常是n,否则由NET_PRED.CPP设置,ARMAPRED.CPP
int npred; //未来预测置信区间数
double * interval; //这是他们(2 * npred long),在NP_CONF.CPP
int mult_conf中分配; //通常为0,1如果'interval'是乘法的

void replace(int n,int n_protect,double * x);
void center();
int median_center();
void undo_center(Signal * per);
void detrend();
void undo_detrend(Signal * per);
void offset(double val);
void undo_offset(Signal * per);
void scale(double val);
void undo_scale(Signal * per);
void standardize();
void undo_standardize(Signal * per);
无效差异(int degree);
int undo_difference(Signal * per);
int seasonal_diff(int period);
int undo_seasonal_diff(Signal * per);
void integrate(int period);
void siglog();
void sigexp();
}





这是SIGNAL.cpp文件中的定义:



 int Signal :: undo_difference(Signal * sigptr)
{
int i,pass,pass;
double temp,sum,* dptr;
remove_display(this); // Windows必须删除MDI子项,如果显示
if(sigptr!= NULL){
if(sigptr-> differenced)
pass = sigptr-> differenced;
其他
返回0;
}
其他
通过=差异;
MEMTEXT(SIGNAL:undo_difference);
dptr =(double *)REALLOC(sig,(n + pass)* sizeof(double));
if(dptr == NULL)
返回1;
sig = dptr;

for(pass = 0; pass< pass; pass ++){
if(sigptr!= NULL)
sum = sigptr-> leads [pass-pass-1] ;
else
sum = leads [pass-pass-1];
for(i = 0; i< n; i ++){
temp = sig [i];
sig [i] =总和;
sum + = temp;
}
sig [n ++] = sum;
}
type = DataSignal;
known_n + =通过;
返回0;
};





在Google等上好好看看,但坚持到这里。怀疑C可能存在声明问题作为.C文件提供,但包含没有区别。



我很欣赏某些方向。



感谢

解决方案

FYMPAXPAXI @ Z)在函数public:int __clrcall Signal :: undo_difference中引用*)(?undo_difference @ Signal @@


FQAMHPAV1 @@ Z)SIGNAL.obj





这是头文件FUNCDEFS.h中的令牌(我认为!)声明:

 extern void * memrealloc(void * ptr,unsigned int size); 





因此EXTERN.h中的代码是:

 extern TDecoratedMDIFrame * frame; 
extern npredictMDIClient * mdiClient;





这是头文件CLASSES.h中的Class声明:



 class Signal {

public:
Signal(char * signame,int length,double * signal);
~Signal();

enum SignalType类型; //优化显示
int n; //信号长度
char * name; //它的名字
double * sig; //这里是
int居中; //它是否居中?
双分; //它的中心如果是这样的
int detrended; //它已经去了吗?
双坡; //斜率,如果是这样的话
double pivot; //和枢轴点
int offsetted; //它被抵消了吗?
双倍; //如果是这样的偏移
int缩放; //它已经缩放了吗?
双倍标准; //其规模如果是这样的话,那么
int标准化; //它已经标准化了吗?
双倍均值; //它的意思是这样的
double std; //和它的标准差
int差异; //它有区别吗? (学位如果是这样的话)
double leads [3]; //差异
int季节性之前的第一个点; //季节性差异吗? (如果是这样的话)
double * sleads; //第一个句点如果是这样的话
int source_n; //如果CORRELATION或SPECTRUM,定义信号的长度
int known_n; //通常是n,否则由NET_PRED.CPP设置,ARMAPRED.CPP
int npred; //未来预测置信区间数
double * interval; //这是他们(2 * npred long),在NP_CONF.CPP
int mult_conf中分配; //通常为0,1如果'interval'是乘法的

void replace(int n,int n_protect,double * x);
void center();
int median_center();
void undo_center(Signal * per);
void detrend();
void undo_detrend(Signal * per);
void offset(double val);
void undo_offset(Signal * per);
void scale(double val);
void undo_scale(Signal * per);
void standardize();
void undo_standardize(Signal * per);
无效差异(int degree);
int undo_difference(Signal * per);
int seasonal_diff(int period);
int undo_seasonal_diff(Signal * per);
void integrate(int period);
void siglog();
void sigexp();
}





这是SIGNAL.cpp文件中的定义:



 int Signal :: undo_difference(Signal * sigptr)
{
int i,pass,pass;
double temp,sum,* dptr;
remove_display(this); // Windows必须删除MDI子项,如果显示
if(sigptr!= NULL){
if(sigptr-> differenced)
pass = sigptr-> differenced;
其他
返回0;
}
其他
通过=差异;
MEMTEXT(SIGNAL:undo_difference);
dptr =(double *)REALLOC(sig,(n + pass)* sizeof(double));
if(dptr == NULL)
返回1;
sig = dptr;

for(pass = 0; pass< pass; pass ++){
if(sigptr!= NULL)
sum = sigptr-> leads [pass-pass-1] ;
else
sum = leads [pass-pass-1];
for(i = 0; i< n; i ++){
temp = sig [i];
sig [i] =总和;
sum + = temp;
}
sig [n ++] = sum;
}
type = DataSignal;
known_n + =通过;
返回0;
};





在Google等上好好看看,但坚持到这里。怀疑C可能存在声明问题作为.C文件提供,但包含没有区别。



我很欣赏某些方向。



谢谢


您的项目是否托管 C ++ '?此 Stack Overflow 问题可能有所帮助:托管C ++未解决令牌 [ ^ ]

Hi
Just starting out with VS2008 C++

I'm trying to compile code from an old C++ project into a Windows Forms project. When I compile I'm getting LNK2028 errors for several of the objects of a Class. The Class is declared in a CLASSES.h file but does not seem to be recognized in the SIGNAL.cpp file. Here is the error which is typical of several:

Error	1	error LNK2028: unresolved token (0A000009) "void * __clrcall memrealloc(void *,unsigned int)" (?memrealloc@@$$FYMPAXPAXI@Z) referenced in function "public: int __clrcall Signal::undo_difference(class Signal *)" (?undo_difference@Signal@@$$FQAMHPAV1@@Z)	SIGNAL.obj



Here is the "token" (I think!) declaration in the header file FUNCDEFS.h:

extern void *memrealloc ( void *ptr , unsigned int size ) ;



Code within EXTERN.h is thus:

extern TDecoratedMDIFrame *frame ;
extern npredictMDIClient  *mdiClient ;



Here is the Class declaration in the header file CLASSES.h:

class Signal {

public:
   Signal ( char *signame , int length , double *signal ) ;
   ~Signal () ;

   enum SignalType type ;  // Optimizes display
   int n ;             // Length of signal
   char *name ;        // Its name
   double *sig ;       // It is here
   int centered ;      // Has it been centered?
   double cent ;       // Its center if so
   int detrended ;     // Has it been detrended?
   double slope ;      // Slope if so
   double pivot ;      // And pivot point
   int offsetted ;     // Has it been offset?
   double offst ;      // Offset if so
   int scaled ;        // Has it been scaled?
   double scal ;       // Its scale if so
   int standardized ;  // Has it been standardized?
   double mean ;       // Its mean if so
   double std ;        // And its standard deviation
   int differenced ;   // Has it been differenced?  (Degree if so)
   double leads[3] ;   // First points before differencing
   int seasonal ;      // Has it been seasonally differenced? (Period if so)
   double *sleads ;    // First period points if so
   int source_n ;      // If CORRELATION or SPECTRUM, length of defining signal
   int known_n ;       // Normally n, else set by NET_PRED.CPP, ARMAPRED.CPP
   int npred ;         // Number of future prediction confidence intervals
   double *intervals ; // This is them (2 * npred long), alloced in NP_CONF.CPP
   int mult_conf ;     // Normally 0, 1 if 'intervals' are multiplicative

   void replace ( int n , int n_protect , double *x ) ;
   void center () ;
   int median_center () ;
   void undo_center ( Signal *per ) ;
   void detrend () ;
   void undo_detrend ( Signal *per ) ;
   void offset ( double val ) ;
   void undo_offset ( Signal *per ) ;
   void scale ( double val ) ;
   void undo_scale ( Signal *per ) ;
   void standardize () ;
   void undo_standardize ( Signal *per ) ;
   void difference ( int degree ) ;
   int undo_difference ( Signal *per ) ;
   int seasonal_diff ( int period ) ;
   int undo_seasonal_diff ( Signal *per ) ;
   void integrate ( int period ) ;
   void siglog () ;
   void sigexp () ;
}



Here is the definition in the SIGNAL.cpp file:

int Signal::undo_difference ( Signal *sigptr )
{
   int i, pass, passes ;
   double temp, sum, *dptr ;
   remove_display ( this ) ; // Windows must remove MDI child if displayed
   if (sigptr != NULL) {
      if (sigptr->differenced)
         passes = sigptr->differenced ;
      else
         return 0 ;
      }
   else
      passes = differenced ;
   MEMTEXT ( "SIGNAL: undo_difference" ) ;
   dptr = (double *) REALLOC ( sig , (n+passes) * sizeof(double) ) ;
   if (dptr == NULL)
      return 1 ;
   sig = dptr ;
   
   for (pass=0 ; pass<passes ; pass++) {
      if (sigptr != NULL)
         sum = sigptr->leads[passes-pass-1] ;
      else
         sum = leads[passes-pass-1] ;
      for (i=0 ; i<n ; i++) {
         temp = sig[i] ;
         sig[i] = sum ;
         sum += temp ;
         }
      sig[n++] = sum ;
      }
   type = DataSignal ;
   known_n += passes ;
   return 0 ;
};



Have had a good look around on Google etc but stuck here. suspect that there might be a declaration issue with C as a .C file supplied as well but inclusion makes no difference.

I'd appreciate some direction.

Thanks

解决方案

FYMPAXPAXI@Z) referenced in function "public: int __clrcall Signal::undo_difference(class Signal *)" (?undo_difference@Signal@@


FQAMHPAV1@@Z) SIGNAL.obj



Here is the "token" (I think!) declaration in the header file FUNCDEFS.h:

extern void *memrealloc ( void *ptr , unsigned int size ) ;



Code within EXTERN.h is thus:

extern TDecoratedMDIFrame *frame ;
extern npredictMDIClient  *mdiClient ;



Here is the Class declaration in the header file CLASSES.h:

class Signal {

public:
   Signal ( char *signame , int length , double *signal ) ;
   ~Signal () ;

   enum SignalType type ;  // Optimizes display
   int n ;             // Length of signal
   char *name ;        // Its name
   double *sig ;       // It is here
   int centered ;      // Has it been centered?
   double cent ;       // Its center if so
   int detrended ;     // Has it been detrended?
   double slope ;      // Slope if so
   double pivot ;      // And pivot point
   int offsetted ;     // Has it been offset?
   double offst ;      // Offset if so
   int scaled ;        // Has it been scaled?
   double scal ;       // Its scale if so
   int standardized ;  // Has it been standardized?
   double mean ;       // Its mean if so
   double std ;        // And its standard deviation
   int differenced ;   // Has it been differenced?  (Degree if so)
   double leads[3] ;   // First points before differencing
   int seasonal ;      // Has it been seasonally differenced? (Period if so)
   double *sleads ;    // First period points if so
   int source_n ;      // If CORRELATION or SPECTRUM, length of defining signal
   int known_n ;       // Normally n, else set by NET_PRED.CPP, ARMAPRED.CPP
   int npred ;         // Number of future prediction confidence intervals
   double *intervals ; // This is them (2 * npred long), alloced in NP_CONF.CPP
   int mult_conf ;     // Normally 0, 1 if 'intervals' are multiplicative

   void replace ( int n , int n_protect , double *x ) ;
   void center () ;
   int median_center () ;
   void undo_center ( Signal *per ) ;
   void detrend () ;
   void undo_detrend ( Signal *per ) ;
   void offset ( double val ) ;
   void undo_offset ( Signal *per ) ;
   void scale ( double val ) ;
   void undo_scale ( Signal *per ) ;
   void standardize () ;
   void undo_standardize ( Signal *per ) ;
   void difference ( int degree ) ;
   int undo_difference ( Signal *per ) ;
   int seasonal_diff ( int period ) ;
   int undo_seasonal_diff ( Signal *per ) ;
   void integrate ( int period ) ;
   void siglog () ;
   void sigexp () ;
}



Here is the definition in the SIGNAL.cpp file:

int Signal::undo_difference ( Signal *sigptr )
{
   int i, pass, passes ;
   double temp, sum, *dptr ;
   remove_display ( this ) ; // Windows must remove MDI child if displayed
   if (sigptr != NULL) {
      if (sigptr->differenced)
         passes = sigptr->differenced ;
      else
         return 0 ;
      }
   else
      passes = differenced ;
   MEMTEXT ( "SIGNAL: undo_difference" ) ;
   dptr = (double *) REALLOC ( sig , (n+passes) * sizeof(double) ) ;
   if (dptr == NULL)
      return 1 ;
   sig = dptr ;
   
   for (pass=0 ; pass<passes ; pass++) {
      if (sigptr != NULL)
         sum = sigptr->leads[passes-pass-1] ;
      else
         sum = leads[passes-pass-1] ;
      for (i=0 ; i<n ; i++) {
         temp = sig[i] ;
         sig[i] = sum ;
         sum += temp ;
         }
      sig[n++] = sum ;
      }
   type = DataSignal ;
   known_n += passes ;
   return 0 ;
};



Have had a good look around on Google etc but stuck here. suspect that there might be a declaration issue with C as a .C file supplied as well but inclusion makes no difference.

I'd appreciate some direction.

Thanks


Is, by chance, your project 'managed C++'? This Stack Overflow question might help: "Managed C++ unresolved token"[^].


这篇关于VS 2008 LNK 2028错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆