Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 18:01:29 +0000



Post From: ACSIL: using std::map (dictionary) for referring to Subraphs

[2015-10-27 19:47:27]
User44052 - Posts: 34
Hello again.

I'm using std::map types extensively in my studies, and they compile with no problems (and run smoothly) when I use SierraChart's built-in compiler function (with code written in Notepad++).

Today I tried moving to Visual C++ 2010 Express, but it seems the use of std::map types causes a fatal error. I followed the guide on this page:
http://www.sierrachart.com/index.php?page=doc/doc_VCExpress.php#StepByStep

I created the sample study and it compiled well. But when I add any of the two lines at the bottom (to declare std::map's), I get the following error in the Visual C++ environment:

1>My Custom Study DLL in VB.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: bool __thiscall std::_Tree_const_iterator<class std::_Tree_val<class std::_Tmap_traits<class SCString,class c_ArrayWrapper<float>,struct std::less<class SCString>,class std::allocator<struct std::pair<class SCString const ,class c_ArrayWrapper<float> > >,0> > >::operator==(class std::_Tree_const_iterator<class std::_Tree_val<class std::_Tmap_traits<class SCString,class c_ArrayWrapper<float>,struct std::less<class SCString>,class std::allocator<struct std::pair<class SCString const ,class c_ArrayWrapper<float> > >,0> > > const &)const " (??8?$_Tree_const_iterator@V?$_Tree_val@V?$_Tmap_traits@VSCString@@V?$c_ArrayWrapper@M@@U?$less@VSCString@@@std@@V?$allocator@U?$pair@$$CBVSCString@@V?$c_ArrayWrapper@M@@@std@@@4@$0A@@std@@@std@@@std@@QBE_NABV01@@Z)
1>libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
1>C:\SierraChart_Standalone\Data\My Custom Study in VB.dll : fatal error LNK1120: 1 unresolved externals
The code is below. As I mentioned, it compiles with no problems whatsoever within Sierra and Notepad++. The problem only arises when using Visual C++ Studio.


#include "sierrachart.h"
SCDLLName("My Custom Study DLL")

SCSFExport scsf_template(SCStudyGraphRef sc)
{
  if (sc.SetDefaults)
  {
    sc.GraphName = "Color Bar Based on Bid/Ask Volume";
    sc.StudyDescription = "";
    sc.AutoLoop = 1;//true
    sc.GraphRegion = 0;
    sc.FreeDLL = 1;
    sc.CalculationPrecedence = LOW_PREC_LEVEL;
    
    return;
  }
  std::map<SCString, SCFloatArray> myArrayMap; // <---- this line causes error
  std::map<SCString, float> simpleMap; //this line too
}


Any help is appreciated, as always.
Date Time Of Last Edit: 2015-10-27 19:48:05