Login Page - Create Account

Support Board


Date/Time: Sat, 28 Dec 2024 23:25:41 +0000



compiler error

View Count: 825

[2016-01-22 16:30:52]
jivetrader - Posts: 410
-- Starting build of Custom Studies Source files: cg_b1.cpp. -- 11:27:38

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

C:\SierraChart\ACS_Source\cg_b1.cpp:3:10: error: expected constructor, destructor, or type conversion before '(' token
SCDLLInit("CG_b1");
^
-- End of Build -- 11:27:39
[2016-01-22 16:59:05]
Sierra Chart - Max - Posts: 5770
Replace:

SCDLLInit("CG_b1");

With:

SCDLLName("CG_b1");

Sierra Chart Support
Date Time Of Last Edit: 2016-01-22 18:42:28
[2016-01-22 18:06:24]
jivetrader - Posts: 410
-- Starting build of Custom Studies Source files: ehlers_b1.cpp. -- 13:05:50

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

C:\SierraChart\ACS_Source\ehlers_b1.cpp:7:10: error: expected constructor, destructor, or type conversion before '(' token
SCDLLInit("ehlers#1");
^
-- End of Build -- 13:05:51



STUDY CODE:

#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <math.h>
#include "sierrachart.h"


SCDLLInit("ehlers#1");
SCDLLName("ehlers#1")

SCSFExport scsf_ehlers(SCStudyInterfaceRef sc)
{
  SCSubgraphRef Ehlers     = sc.Subgraph[0];
  SCSubgraphRef Mid       = sc.Subgraph[1];

  if (sc.SetDefaults)
  {
    sc.GraphName       = "ehlers#1";
    sc.StudyDescription   = "ehlers#1 >> beta 1<< @ganz";

    Ehlers.Name       = "ehlers#1";
    Ehlers.DrawStyle     = DRAWSTYLE_LINE;
    Ehlers.PrimaryColor     = RGB(255,255,0);
    Ehlers.LineWidth     = 2;
    
    sc.GraphRegion       = 1;
    sc.ValueFormat       = 2;
    sc.AutoLoop       = 1;
    sc.FreeDLL         = 0;
    
    return;
  }
  
  float a1, b1, c1, c2, c3;
  
  a1 = exp( (-1.414) *3.14159/10);
  
  b1 = 2*a1*cos(1.414*(180*3.14159/180)/10);
  
  c2 = b1;
  
  c3 = (-1)*a1*a1;
  
  c1 = 1- c2 - c3;
  
  // Ehlers[sc.Index] = c1*(sc.BaseDataIn[SC_LAST][sc.Index] + sc.BaseDataIn[SC_LAST][sc.Index-2] )/2 +c2*Ehlers[sc.Index]+c3*Ehlers[sc.Index];
      
  float al, tr, fi;
  
  tr = 360*3.14159/180;
  fi = 0.707*tr/48;
  
  al = (cos(fi) + sin(fi) - 1)/cos(fi);
  
  Mid[sc.Index] = (1-al/2)*(1-al/2)*(sc.BaseDataIn[SC_LAST][sc.Index]-2*sc.BaseDataIn[SC_LAST][sc.Index-1]+sc.BaseDataIn[SC_LAST][sc.Index-2])+2*(1-al)*Mid[sc.Index-1] - (1-al)*(1-al)*Mid[sc.Index-2];
  
  Ehlers[sc.Index] = c1*(Mid[sc.Index] +Mid[sc.Index-1] )/2 +c2*Ehlers[sc.Index-1]+c3*Ehlers[sc.Index-2];
      
}
[2016-01-22 18:43:30]
Sierra Chart Engineering - Posts: 104368
Remove
SCDLLInit("ehlers#1");

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