我有太多代码要发布,但我不断收到重复的编译错误,即Orderbk
在我的项目中无法识别类。
最奇怪的是其中没有实际的编译错误Orderbk
(这会导致所有其他类无法识别它是可以理解的)。
Orderbk
有人可以给我线索,因为我的编译器没有看到内部问题,但每个类引用都Orderbk
报告它未定义,这可能是什么问题?
1>------ Build started: Project: FXDcr (Intel C++ 13.0), Configuration: Debug x64 ------
1> Derivative.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1>C:\DXDcr\FXDcr\Stk.h(35): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> FXDcr.cpp
1> FXMsg.cpp
1> Fut.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1>C:\DXDcr\FXDcr\Stk.h(35): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> Index.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> Instr.cpp
1>C:\DXDcr\FXDcr\Stk.h(13): error : not a class or struct name
1> class Stock : public Instr {
1> ^
1>
1>C:\DXDcr\FXDcr\Stk.h(35): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1>C:\DXDcr\FXDcr\Mappings.h(31): error : identifier "Instr" is undefined
1> static unordered_map<string, boost::shared_ptr<Instr> > GetDictOfAllInstrs();
1> ^
1>
1> Main.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> Mappings.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> Order.cpp
1> Stock.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1> SIA.cpp
1>C:\DXDcr\FXDcr\Instr.h(29): error : identifier "Orderbk" is undefined
1> Orderbk getOrderbk();
1> ^
1>
1>C:\DXDcr\FXDcr\Instr.h(33): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
1>C:\DXDcr\FXDcr\Stk.h(35): error : identifier "Orderbk" is undefined
1> Orderbk orderbk;
1> ^
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
编辑我所有的头文件格式为:
#ifndef CLASS_H
#define CLASS_H
class CLASS{
};
#endif