簡體   English   中英

第三方(保證有效)代碼中的編譯時錯誤

[英]compile-time errors in third-parties (guaranteed to be valid) code

我在項目中使用QuickFAST 當我嘗試編譯時,我在QuickFAST收到很多編譯時錯誤。 但是,可以保證QuickFAST代碼是有效的(當我單獨打開它時,我就可以對其進行編譯)。

為什么我會在有效代碼中收到此編譯時錯誤,以及如何解決該錯誤?

typedef boost::shared_ptr<ValueMessageBuilder> ValueMessageBuilderPtr;

Error   3   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   e:\quickfast\quickfast_1_4_0\src\messages\ValueMessageBuilder_fwd.h 14  1   FastNativeAdapter

typedef boost::uint16_t uint16;

Error   15  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   E:\quickfast\quickfast_1_4_0\src\Common\Types.h 23  1   FastNativeAdapter

typedef boost::shared_ptr<ValueMessageBuilder> ValueMessageBuilderPtr;

Error   1   error C2653: 'boost' : is not a class or namespace name e:\quickfast\quickfast_1_4_0\src\messages\ValueMessageBuilder_fwd.h 14  1   FastNativeAdapter


void setValue(const uint64 value)

Error   255 error C2535: 'void QuickFAST::Value::setValue(const int)' : member function already defined or declared E:\quickfast\quickfast_1_4_0\src\Common\Value.h 99  1   FastNativeAdapter


virtual void addValue(FieldIdentityCPtr & identity, ValueType::Type type, const uint64 value) = 0;

Error   45  error C2535: 'void QuickFAST::Messages::ValueMessageBuilder::addValue(QuickFAST::Messages::FieldIdentityCPtr &,QuickFAST::ValueType::Type,const int)' : member function already defined or declared E:\quickfast\quickfast_1_4_0\src\Messages\ValueMessageBuilder.h 42  1   FastNativeAdapter

void setValue(const int8 value)
{
  class_ = SIGNEDINTEGER;
  cachedString_ = false;
  signedInteger_ = value;
}

Error   310 error C2065: 'value' : undeclared identifier    E:\quickfast\quickfast_1_4_0\src\Common\Value.h 147 1   FastNativeAdapter

boost include和lib文件已添加到項目中。

更新:

我發現僅包含QuickFAST文件就足夠了,例如#include "Messages/ValueMessageBuilder.h" 此后,盡管我從不QuickFAST或使用任何QuickFAST類,但仍收到上述編譯錯誤。

如果刪除#include "Messages/ValueMessageBuilder.h" ,錯誤就會消失(因為在整個程序中,我永遠不會引用任何QuickFAST文件。

因此,重點是-僅包含文件就足夠了。 因此,可能以某種方式將QuickFAST源鏈接到我的項目錯了嗎? 我剛剛在項目屬性中添加了include和lib文件...

QuickFAST的常見問題解答中發現了這一點 ,它有助於:

要解決此問題,大多數應用程序應將$QUICKFAST_HOME/src設置為包含目錄, 並在包含任何其他QuickFAST標頭之前包含<Application/QuickFAST.h> 使用預編譯頭文件的應用程序應在其預編譯頭文件中包含此頭文件。

只需包含Application/QuickFAST.h然后再包含其他任何內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM