Login Page - Create Account

Support Board


Date/Time: Mon, 16 Jun 2025 16:50:26 +0000



[Programming Help] - error code C2062, C2143 & C2447

View Count: 248

[2025-05-06 15:18:33]
User108811 - Posts: 11
can anyone help, i'm trying to code on C++ but i keep getting these errors above:

#include "sierrachart.h"

SCDLLName("Test_Compile_Check")

SCSFExport void scsf_TestCompileCheck(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Test Compile Check";
sc.AutoLoop = 1;
sc.GraphRegion = 0;
return;
}

// No processing logic - this is just a stub for testing compile
}
[2025-05-06 15:42:34]
User431178 - Posts: 713
Are you sure that sierrachart.h is being found correctly?
Where/how exactly are you building your code?
[2025-05-06 16:00:03]
User108811 - Posts: 11
not sure if sierrachart.h is being found correctly.

i'm using Notepad++
[2025-05-06 16:35:39]
User431178 - Posts: 713
I just noticed what it is...

This is wrong:

SCSFExport void scsf_TestCompileCheck(SCStudyInterfaceRef sc)

Should instead be:

SCSFExport scsf_TestCompileCheck(SCStudyInterfaceRef sc)

SCSFExport is a macro that sets the return type for the function, amongst other things, so your "void" is not needed.
[2025-05-06 19:06:07]
User108811 - Posts: 11
Thank you that worked. I was stuck here for 2 days :(...

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

Login

Login Page - Create Account