PandoraTrader icon indicating copy to clipboard operation
PandoraTrader copied to clipboard

linux下编译通不过

Open pubyun opened this issue 9 months ago • 1 comments

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

pubyun avatar Mar 10 '25 05:03 pubyun

建议需要适配多种环境,熟悉C++开发和编译的,可以简要描述您自身情况以及参与项目意愿发送邮件到[[email protected]]申请加入核心开发计划。 这样可以使用源码做相关编译和适配。

pegasusTrader avatar Mar 11 '25 01:03 pegasusTrader

@pubyun 已调整升级 Linux 相关的编译构建流程,同步最新 develop 分支版本后再试试

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

[ 5%] Building CXX object PandoraStrategy/CMakeFiles/PandoraStrategy.dir/cwNetValueEvaluation.cpp.o In file included from

pseudocodes avatar Aug 06 '25 05:08 pseudocodes