Support Board
Date/Time: Sun, 06 Jul 2025 09:15:18 +0000
Keep getting an error.
View Count: 70
[2025-06-29 15:34:00] |
User520975 - Posts: 6 |
#include "sierrachart.h" SCDLLName("Test Study") SCSFExport void scsf_TestStudy(SCStudyInterfaceRef sc) { if (sc.SetDefaults) { sc.GraphName = "Test Study"; sc.AutoLoop = 1; return; } } Why does This test cpp keep getting errors? error: two or more data types in declaration of 'scsf_TestStudy' I’ve now tested with both: • SCStudyInterfaceRef sc • and the fully expanded struct s_sc& sc using this exact minimal study: #include "sierrachart.h" SCDLLName("Test Study") SCSFExport void scsf_TestStudy(struct s_sc& sc) { if (sc.SetDefaults) { sc.GraphName = "Test Study"; sc.AutoLoop = 1; return; } } This still fails with: error: two or more data types in declaration of 'scsf_TestStudy' I believe the issue is not in the source code but in the remote builder environment itself (e.g., macro expansion or header conflict on the server). Please advise — this is blocking all custom study development. Date Time Of Last Edit: 2025-06-29 16:02:12
|
[2025-06-29 16:03:26] |
User431178 - Posts: 733 |
error: two or more data types in declaration of 'scsf_TestStudy'
Means that this is wrong: SCSFExport void scsf_TestStudy(SCStudyInterfaceRef sc) The macro, SCSFExport, includes the function type already, so the void in your declaration is causing the "two or more data types" error. Use this instead: SCSFExport scsf_TestStudy(SCStudyInterfaceRef sc) This is the same answer to the last time you posted the same error - Why does this test cpp keep getting the same error? |
[2025-06-29 16:04:06] |
User431178 - Posts: 733 |
I believe the issue is not in the source code but in the remote builder environment itself (e.g., macro expansion or header conflict on the server). Please advise — this is blocking all custom study development.
No, the error is in your code. |
[2025-06-29 16:08:18] |
User431178 - Posts: 733 |
SCSFExport expands to extern "C" __declspec(dllexport) void __cdecl so your function declaration with expanded macro reads extern "C" __declspec(dllexport) void __cdecl void scsf_TestStudy(SCStudyInterfaceRef sc) so the problem is void void in the expanded declaration |
To post a message in this thread, you need to log in with your Sierra Chart account: