Posted By: Zheka
Using STL in Zorro strategies - 09/22/20 12:50
I needed to use an unordered_map<> in my c++ code.
However, just adding #include <unordered_map> in the header file with the definition of the relevant class (even without using this container) generates numerous compiler errors.
Including it in pch.h kinda works, but shows a conflict around 'string'
C:\Users\Administrator\source\repos\EA_MasterPortfolioCPP\EA_Vars.h(147,1): error C2872: 'string': ambiguous symbol
1>C:\Zorro\include\trading.h(13,15): message : could be 'char *string'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xstring(4564,7): message : or 'std::string'
Which concerns not only my script but the whole of Zorro framework which relies upon typedef char* string; in trading.h. (e.g. string sExchange, etc)
Wouldn't it be better to change this typedef to a different name (for c++)?
If not, what's the workaround?
However, just adding #include <unordered_map> in the header file with the definition of the relevant class (even without using this container) generates numerous compiler errors.
Including it in pch.h kinda works, but shows a conflict around 'string'
C:\Users\Administrator\source\repos\EA_MasterPortfolioCPP\EA_Vars.h(147,1): error C2872: 'string': ambiguous symbol
1>C:\Zorro\include\trading.h(13,15): message : could be 'char *string'
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\xstring(4564,7): message : or 'std::string'
Which concerns not only my script but the whole of Zorro framework which relies upon typedef char* string; in trading.h. (e.g. string sExchange, etc)
Wouldn't it be better to change this typedef to a different name (for c++)?
If not, what's the workaround?