Login Page - Create Account

Support Board


Date/Time: Thu, 06 Feb 2025 19:14:45 +0000



Post From: Compiling Error in version 2098

[2020-05-04 12:04:36]
rahul - Posts: 167
Hello, this part of my code used to work properly, but it's not compiling in version 2098.

SCDateTime CurrentSystemDate    = sc.CurrentSystemDateTime;
SCDateTime PnLCalculation_LiveTrade = (CurrentSystemDate - (10 * DAYS));

Error is:
ambiguous overload for 'operator-' (operand types are 'SCDateTime' and 'double')
SCDateTime PnLCalculation_LiveTrade = (CurrentSystemDate - (10 * DAYS));

^
note: candidate: operator-(double, double) <built-in>
In file included from scstructures.h:98:0,
from sierrachart.h:19,
scdatetime.h:1476:19: note: candidate: SCDateTime SCDateTime::operator-(const SCDateTime&) const
inline SCDateTime SCDateTime::operator -(const SCDateTime& DateTime) const

When I look at the documentation, I don't know what's changed.
Can you please provide a fix?
Date Time Of Last Edit: 2020-05-04 12:07:37