Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 14:58:25 +0000



[Programming Help] - Visual Studio won't build Study when sc.VolumeAtPriceForBars->GetVAPElementAtIndex is used

View Count: 2707

[2015-09-26 15:45:31]
Viacheslav Malafeev - Posts: 88
Dear Support,
I've got a problem building my ACSIL custom study once I've added this code.

s_VolumeAtPriceV2 *p_VolumeAtPriceAtIndex;
...
sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, ElementIndex, &p_VolumeAtPriceAtIndex);

The error coming is this:
Creating library ..\..\..\..\..\..\..\SierraChart\Data\Entries.lib and object ..\..\..\..\..\..\..\SierraChart\Data\Entries.exp
1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)
1>..\..\..\..\..\..\..\SierraChart\Data\Entries.dll : fatal error LNK1120: 1 unresolved externals
Once the line
sc.VolumeAtPriceForBars->GetVAPElementAtIndex(sc.Index, ElementIndex, &p_VolumeAtPriceAtIndex)
is commented, the study builds just fine.

I'm using Microsoft Visual Studio 2013. I've experimented with the built-in compiler, and it builds OK, so I figure it's Visual Studio issue.

What should I do?

Thanks!
Date Time Of Last Edit: 2015-09-27 01:22:12
[2015-09-27 03:45:32]
Sierra Chart Engineering - Posts: 104368
Not sure what to do. Basically this requires a lot of research as to why this is occurring. We checked a couple of things that came to mind but those are not an issue.

So at the moment, we do not have an answer.

It is also a good reason why we stay away from the newer versions of Microsoft compilers. Usually we wait for 2 years before adopting a new version. And we still use version 2010 now with no plans to update.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2015-09-27 22:59:04]
Sierra Chart Engineering - Posts: 104368
One thing you can do that most probably will solve this is to build a "Release" build and not a "Debug" build of your DLL.

The only disadvantage, is obviously you cannot perform step-by-step debugging.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2015-09-27 22:59:33
[2018-06-09 20:30:01]
TedMar - Posts: 189
I have same Problem too,

>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)

by the way, many Errors when i try Build Studies8.ccp

1>studies8.obj : error LNK2019: unresolved external symbol "class c_ArrayWrapper<float> & __cdecl MovingMedian_S(class c_ArrayWrapper<float> &,class c_ArrayWrapper<float> &,class c_ArrayWrapper<float> &,int,int)" (?MovingMedian_S@@YAAAV?$c_ArrayWrapper@M@@AAV1@00HH@Z) referenced in function _scsf_RelativeVolume
1>studies8.obj : error LNK2019: unresolved external symbol "int __cdecl IsSwingHighAllowEqual_S(struct s_sc &,int,int,int)" (?IsSwingHighAllowEqual_S@@YAHAAUs_sc@@HHH@Z) referenced in function _scsf_SwingHighAndLowCustom
1>studies8.obj : error LNK2019: unresolved external symbol "int __cdecl IsSwingLowAllowEqual_S(struct s_sc &,int,int,int)" (?IsSwingLowAllowEqual_S@@YAHAAUs_sc@@HHH@Z) referenced in function _scsf_SwingHighAndLowCustom
1>studies8.obj : error LNK2019: unresolved external symbol "int __cdecl CalculatePivotPoints(float,float,float,float,float,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,int)" (?CalculatePivotPoints@@YAHMMMMMAAM0000000000000000000000000000H@Z) referenced in function _scsf_PivotPointsVariablePeriod
1>studies8.obj : error LNK2019: unresolved external symbol "int __cdecl CalculateDailyOHLC(struct s_sc &,int,int,int,int,int,int,class SCGraphData &,class SCDateTimeArray &,int,float &,float &,float &,float &,float &,int)" (?CalculateDailyOHLC@@YAHAAUs_sc@@HHHHHHAAVSCGraphData@@AAVSCDateTimeArray@@HAAM3333H@Z) referenced in function _scsf_DailyOHLC
1>studies8.obj : error LNK2019: unresolved external symbol "int __cdecl CalculateDailyPivotPoints(struct s_sc &,int,int,int,class SCGraphData &,class SCDateTimeArray &,int,int,int,int,float,float,float,float,int,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &,float &)" (?CalculateDailyPivotPoints@@YAHAAUs_sc@@HHHAAVSCGraphData@@AAVSCDateTimeArray@@HHHHMMMMHAAM3333333333333333333333333333@Z) referenced in function _scsf_PivotPointsDaily
1>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)




VS 2017, SC 1761
Date Time Of Last Edit: 2018-06-09 20:45:54
[2018-06-10 00:55:49]
Sierra Chart Engineering - Posts: 104368
>libcpmtd.lib(stdthrow.obj) : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z)
This relates to using the release build of the C++ libraries when you need the debug build.

Studies8.cpp is not meant to be compiled on its own. You need to take the particular functions you need from that file, and also any dependent functions and contain them in a single CPP file and make sure you have added the necessary function declarations as well.

Refer to this page:
http://www.sierrachart.com/index.php?page=doc/HowToBuildAnAdvancedCustomStudyFromSourceCode.html
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-06-10 00:56:12
[2018-06-10 09:21:14]
TedMar - Posts: 189
My idea to quick resolve this problem is remove _DEBUG in VS from "Project Proprty Pages > C/C++ > Preprocessor > Preprocessor Definitions".


I don't know if this has a special effect on other ACSIL projects, What is u idea?
[2018-06-11 17:04:15]
Sierra Chart Engineering - Posts: 104368
We are not sure what effect that might have and we do not recommend doing that.

Refer specifically to step 11 here for a solution:
https://www.sierrachart.com/index.php?page=doc/UsingVisualCPlusPlus.php#CreateProject

Make sure you build a Release build for when you are done testing the custom studies.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-06-11 17:05:50
[2020-07-07 00:54:52]
User99735 - Posts: 234
Hi,
For future visitors to this page
- The link to step 11 is broken.

Fix is as follows -
Set Project Properties/C++/Code Generation/Run-time Library property to /MTd ( multi threaded debug ) instead of default /MT ( multi threaded ).

The problem is encountered only if you use std functions / structures like vector / map / list etc.

Happy programming!!!

Regards

Vivek

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account