Login Page - Create Account

Support Board


Date/Time: Sat, 10 May 2025 20:20:29 +0000



Post From: Global variable

[2016-01-14 20:21:04]
ertrader - Posts: 682
Hi Support... I'm trying to create a global variable using the code in documenation:

#include "SierraChart.h"
SCDLLName("StudiesFileName")

//This is a global integer variable
int g_GlobalIntegerVariable;

SCSFExport scsf_StudyFunction
{
if (sc.SetDefaults)
{
sc.FreeDLL = FALSE;
}

}


When I try to compile, I get the following error:

-- Starting build of Custom Studies Source files: GlobalVariables.cpp. -- 14:16:37

"C:\SierraChart\CPPCompiler\bin\g++.exe" "C:\SierraChart\ACS_Source\GlobalVariables.cpp" -march=i686 -mtune=i686 -O2 -shared -static -static-libgcc -static-libstdc++ -s -fno-rtti -fno-exceptions -std=gnu++11 -o "C:\files\Sierra_Data\GlobalVariables.dll"

C:\SierraChart\ACS_Source\GlobalVariables.cpp:7:12: error: variable or field 'scsf_StudyFunction' declared void
SCSFExport scsf_StudyFunction
^
C:\SierraChart\ACS_Source\GlobalVariables.cpp:9:5: error: expected primary-expression before 'if'
if (sc.SetDefaults)
^
C:\SierraChart\ACS_Source\GlobalVariables.cpp:9:5: error: expected '}' before 'if'
C:\SierraChart\ACS_Source\GlobalVariables.cpp:14:1: error: expected declaration before '}' token
}
^
-- End of Build -- 14:16:38

Can you please let me know what am I doing wrong?

Thank you!
Date Time Of Last Edit: 2016-01-14 20:22:31