次のクラスと対応するヘッダー ファイルがあります。
#ifndef ORDER_H_
#define ORDER_H_
#include "Side.h"
using namespace std;
class Order {
public:
int _id;
Side _side;
int _ackedPrc;
int _ackedQty;
int _requestedPrc;
int _requestedQty;
int _filledQty;
Order(){
_id = -1;
_side = BID;
_ackedPrc = -1;
_ackedQty = 0;
_requestedPrc = 0;
_requestedQty = 0;
_filledQty = 0;
}
void cancel(){
_requestedQty = 0;
}
void amend(int prc, int qty){
_requestedPrc = prc;
_requestedQty = qty;
}
void amended(){
_ackedPrc = _requestedPrc;
_ackedQty = _requestedQty;
}
void acked(){
amended();
}
void onFill(int fillQty){
_filledQty += fillQty;
}
int filledQty(){
return _filledQty;
}
int prc(){
return _requestedQty;
}
int remainingQty(){
return _requestedQty - _filledQty;
}
int id(){
return _id;
}
Side side(){
return _side;
}
bool pendingMod(){
return _ackedPrc != _requestedPrc || _ackedQty != _requestedQty;
}
};
#endif
#ifndef ORDER_H_
#define ORDER_H_
#include "Side.h"
class Order {
public:
int _id;
Side _side;
int _ackedPrc;
int _ackedQty;
int _requestedPrc;
int _requestedQty;
int _filledQty;
Order();
void cancel();
void amend(int prc, int qty);
void amended();
void acked();
void onFill(int fillQty);
int filledQty();
int prc();
int remainingQty();
int id();
Side side();
bool pendingMod();
};
#endif /* ORDER_H_ */
このオブジェクトをインスタンス化しようとすると、Mac の CDT/Eclipse で symbol(s) not found エラーが発生します。ただし、プロジェクト内の他のクラスを簡単にインスタンス化できるため、問題は Order クラスにあると確信しています。
int main() {
Order o;//This gives me an error
// OrderBook ob; But this works
// QuoteBook qb; And this works
return 0;
}
誰でも私の問題を見つけることができますか? どこかで私の宣言がどこかで私の定義と一致しないと考え続けていますが、その方法がわかりません。(そして、はい、私は C++ 初心者です。ベスト プラクティス違反はご容赦ください。)
ありがとう