Login Page - Create Account

Support Board


Date/Time: Tue, 18 Jun 2024 12:46:58 +0000



Is try/catch supported for custom indicators?

View Count: 718

[2021-08-27 01:10:04]
Dryheat31 - Posts: 10
I have searched the support board and found numerous mentions of this issue but the only solution that I see provided is to add -fexcptions to the "Additional Compiler Parameters".

However when I add this parameter and select "Remote Build" it still fails and still reports the same message:

HT_HIddenDivMACDx2_64.cpp:265:15: error: exception handling disabled, use '-fexceptions' to enable
265 | catch (char *ErrMsg) {
| ^~~~~~
HT_HIddenDivMACDx2_64.cpp:266:22: error: 'ErrMsg' was not declared in this scope
266 | sc.AddMessageToLog(ErrMsg, 1);

The only way I can get my files to compile without errors is to completely remove all of the try/catch statements from my code. How is the custom study supposed to report run time exceptions to the log if try/catch is not supported?

Is there a solution to this or do I simply have to remove the error handling I have built into my custom indicators?

FYI, I can compile this using Visual Studio 2017 but many installations of Sierra Chart are not able to run the indicators that are compiled through that program. I'm searching for solutions and so far I have not found a clear explanation in any of the support board posts I have reviewed to date. Seems to be a common issue, yet no one who posts about this issue ever receives a workable solution.

Thanks for your time and assistance!
[2021-08-27 02:45:38]
Sierra Chart Engineering - Posts: 104368
We will look into this.
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
[2021-11-06 12:49:08]
User462086 - Posts: 193
Came upon this issue today. Entering '-fexceptions' in the "Additional Compiler Parameters" box has no effect when using Remote Build. Will installing the Visual C++ Compiler provide this functionality? Please advise.

Edit: To answer my own question, installing the "MSVC v140 - VS 2015 C++ build tools" along with Visual Studio appears to have solved this problem.
Date Time Of Last Edit: 2021-11-07 10:36:27
[2021-11-09 11:30:59]
User462086 - Posts: 193
In hindsight, using the VS C++ compiler isn't a feasible solution. The number of errors it finds in code that's been both compiled with REMOTE BUILD and running for some time was overwhelming.

SC, please get the "try-catch" blocks up and running again for the REMOTE BUILD compiler.
[2021-11-16 16:22:32]
Sierra Chart Engineering - Posts: 104368
We will spend some time on this today. We apologize for the delay.
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
[2021-11-17 03:16:47]
Sierra Chart Engineering - Posts: 104368
Try and Catch statements are now supported with Remote Build for C++ 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

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

Login

Login Page - Create Account