Login Page - Create Account

Support Board


Date/Time: Fri, 22 Nov 2024 07:00:51 +0000



ERRPR: Differing values for pack size within the same class (4, 8)

View Count: 112

[2024-10-19 09:42:37]
skalaydzhiyski - Posts: 55
Hi guys,

I am building a trading system entirely using ACSIL + Visual Studio 2022 with C++20 standard features. I wanted to build it following modern C++ guidelines using modules.

This being said, whenever i try to import sierrachart.h in my module .ixx file I am getting
Severity  Code  Description  Project  File  Line  Suppression State  Details
Error  C3614  Differing values for pack size within the same class; previous was was '8', new value is '4'  phitech  C:\Users\spask\source\repos\phitech\paths.ixx  13    

my module file is the simplest possible file:

export module paths;
#include "sierrachart.h"

export namespace phitech
{
namespace paths
{

inline const SCString backtest_trade_stats_path = "C:\\trading\\backtest\\output";

} // namespace backtest
} // namespace phitech

From reading through teh code this is happening because internally for the struct s_SCInput_145 there are some unions with packing set to 4 bytes, but I didn't find any reasonable solution that doesn't include modifying the sierra source code (which I would reaaaaly like to avoid).

I can always revert back to headers worse comes to worst, but I just wanted to check if you have come across this before.

P.S. I am not a C++ guru, hence my post here.
[2024-10-19 15:41:08]
Sierra_Chart Engineering - Posts: 17143
We do not understand the problem.

And we cannot help with it.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-10-19 15:53:16]
skalaydzhiyski - Posts: 55
sorry if my ticket a bit all over the place in terms of phrasing, i just spent hours debugging whats happening. i have a client using c++20 modules (this is currently supported by msvc compiler) but in those modules i cannot import the sierrachart.h header because of the above issue.

i get an error saying there are 2 different struct packings in the same class. in your case - 8 bytes and 4 bytes.

i was wondering if you have come across anyone trying to use c++20 modules with sierra and whether you have any idea how to fix the error above.

to replicate -> just try to import sierrachart.h in a module header (ixx)

i know you guys are busy with more important things and i already have a workaround (switching back to headers instead of modules) but I would love to be able to use the latest c++ features with the sierra's c++ code.
[2024-10-19 19:53:43]
Sierra_Chart Engineering - Posts: 17143
No we have no idea how to fix this and we do not know anything about these "modules".

And our advice is to stay away from this. We would never use modules ourselves. Never. Out of the question.

Just because there is something out there new does not mean it should be used.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-10-19 20:00:03]
skalaydzhiyski - Posts: 55
well it improves compile times bt i agree, new features tend to cause more headache than pleasure :D... all the best

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

Login

Login Page - Create Account