Skip to content

linux下编译通不过 #14

@pubyun

Description

@pubyun

debian 12 和 centos 9 都编译通不过:

[ 5%] Building CXX object PandoraStrategy/CMakeFiles/PandoraStrategy.dir/cwNetValueEvaluation.cpp.o
In file included from /root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:1:
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:29:41: error: field ‘strDateTime’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string’}
29 | std::string strDateTime;
| ^~~~~~~~~~~
In file included from /usr/include/c++/12/iosfwd:39,
from /usr/include/c++/12/bits/shared_ptr.h:52,
from /usr/include/c++/12/memory:77,
from /root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:17:
/usr/include/c++/12/bits/stringfwd.h:72:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
72 | class basic_string;
| ^~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:30:22: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
30 | std::uint64_t iTimeStamp;
| ^~~~~~~~
| wint_t
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:39:14: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
39 | std::uint64_t m_iStartTimeStamp; //ʼʱ
| ^~~~~~~~
| wint_t
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:40:113: error: field ‘m_strStartTimeStamp’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string’}
40 | std::string m_strStartTimeStamp; //ʼʱ
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stringfwd.h:72:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
72 | class basic_string;
| ^~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:41:14: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
41 | std::uint64_t m_iTimeStamp; //ʱ
| ^~~~~~~~
| wint_t
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:42:113: error: field ‘m_strTimeStamp’ has incomplete type ‘std::string’ {aka ‘std::__cxx11::basic_string’}
42 | std::string m_strTimeStamp; //ʱ
| ^~~~~~~~~~~~~~
/usr/include/c++/12/bits/stringfwd.h:72:11: note: declaration of ‘std::string’ {aka ‘class std::__cxx11::basic_string’}
72 | class basic_string;
| ^~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:43:14: error: ‘uint64_t’ in namespace ‘std’ does not name a type; did you mean ‘wint_t’?
43 | std::uint64_t m_iThisDayEndTimeStamp; //ʱĬΪһ16ʱ
| ^~~~~~~~
| wint_t
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:83:44: error: ‘std::uint64_t’ has not been declared
83 | void UpdateNetValueByTotalPNL(std::uint64_t timestamp, double totalPNL, double fundUsed);
| ^~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp: In constructor ‘cwNetValueEvaluation::cwNetValueEvaluation()’:
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:6:11: error: class ‘cwNetValueEvaluation’ does not have any field named ‘m_iTimeStamp’
6 | : m_iTimeStamp(0)
| ^~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:7:11: error: class ‘cwNetValueEvaluation’ does not have any field named ‘m_iStartTimeStamp’
7 | , m_iStartTimeStamp(0)
| ^~~~~~~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp: At global scope:
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:61:6: error: no declaration matches ‘void cwNetValueEvaluation::UpdateNetValueByTotalPNL(uint64_t, double, double)’
61 | void cwNetValueEvaluation::UpdateNetValueByTotalPNL(std::uint64_t timestamp, double totalPNL, double fundUsed)
| ^~~~~~~~~~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:83:14: note: candidate is: ‘void cwNetValueEvaluation::UpdateNetValueByTotalPNL(int, double, double)’
83 | void UpdateNetValueByTotalPNL(std::uint64_t timestamp, double totalPNL, double fundUsed);
| ^~~~~~~~~~~~~~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.h:19:7: note: ‘class cwNetValueEvaluation’ defined here
19 | class cwNetValueEvaluation
| ^~~~~~~~~~~~~~~~~~~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp: In member function ‘void cwNetValueEvaluation::Calculate()’:
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:140:28: error: ‘m_iTimeStamp’ was not declared in this scope; did you mean ‘m_strTimeStamp’?
140 | m_dTradingYears = (m_iTimeStamp - m_iStartTimeStamp) / (1000.0 * 1000 * 24 * 60 * 60 * 365);//24Сʱ6060365
| ^~~~~~~~~~~~
| m_strTimeStamp
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:140:43: error: ‘m_iStartTimeStamp’ was not declared in this scope; did you mean ‘m_strStartTimeStamp’?
140 | m_dTradingYears = (m_iTimeStamp - m_iStartTimeStamp) / (1000.0 * 1000 * 24 * 60 * 60 * 365);//24Сʱ
6060365
| ^~~~~~~~~~~~~~~~~
| m_strStartTimeStamp
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:144:18: error: ‘pow’ was not declared in this scope
144 | m_dIRR = pow(m_dCurNetAsset, m_dTradingYears);
| ^~~
/root/Project/PandoraTrader/PandoraStrategy/cwNetValueEvaluation.cpp:159:33: error: ‘sqrt’ was not declared in this scope
159 | m_dVolatility = sqrt(sum1 / (size - 1) * 252);
| ^~~~
make[2]: *** [PandoraStrategy/CMakeFiles/PandoraStrategy.dir/build.make:174: PandoraStrategy/CMakeFiles/PandoraStrategy.dir/cwNetValueEvaluation.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: PandoraStrategy/CMakeFiles/PandoraStrategy.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions