Support Board
Date/Time: Sun, 12 Jan 2025 11:59:46 +0000
Post From: Problem for linking two CPPs with an .H and compiling it
[2017-02-13 10:10:57] |
User210074 - Posts: 63 |
Hello, I have an error message below. I do not know how to compile the 2 CPPs in DLL without this error Test.cpp #include <iostream> #include <string> #include "Root.h" #include "sierrachart.h" using namespace std; SCDLLName("Test") SCSFExport scsf_Test(SCStudyInterfaceRef sc) { SCSubgraphRef Red = sc.Subgraph[0]; if (sc.SetDefaults){ sc.GraphName = "Test 2 CPP"; sc.GraphRegion = 0; sc.AutoLoop = true; sc.FreeDLL = 1; Red.Name= "Red"; Red.DrawStyle = DRAWSTYLE_VALUE_ON_HIGH; Red.LineWidth = 1; Red.PrimaryColor = RGB(0,128,255); Red.DrawZeros = true; return; }//End defaults double A = 2.0f; double B = 3.0f; double C = 4.0f; double D = 5.0f; double E = 6.0f; double F = 7.0f; Mem(A, B, C, D, E, F); Red[sc.Index]=Mem; }//End Function Root.h #ifndef Root_H_INCLUDED #define Root_H_INCLUDED double Mem(double Z, double Y, double X, double W, double V, double U); #endif // Root_H_INCLUDED Mem.cpp #include <iostream> #include <vector> #include <string> #include "sierrachart.h" #include "Routeur.h" using namespace std; SCDLLName("Mem") SCSFExport scsf_Mem(SCStudyInterfaceRef sc) { if (sc.SetDefaults){return;}//end of defaults double Mem(double Z, double Y, double X, double W, double V, double U){ int const Size(5); int const Ini(0); vector <int> MemTab(Size); MemTab[Z] = Ini; MemTab[Y] = Ini; MemTab[X] = Ini; MemTab[W] = Ini; MemTab[V] = Ini; MemTab[U] = Ini; auto ResA = std::find(std::begin(MemTab), std::end(MemTab), Ini); if(ResA != std::end(MemTab)){return Size;} else{return Ini;} }//End of Mem }//End of Function Error C:\WINDOWS\system32\cmd.exe /C "C:\SierraChart\ACS_Source\VisualCCompile.Bat" C:\SierraChart\ACS_Source>call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" Test.cpp C:\SierraChart\ACS_Source\Test.cpp(28): error C2440: '=': cannot convert from 'double (__cdecl *)(double,double,double,double,double,double)' to 'float' C:\SierraChart\ACS_Source\Test.cpp(28): note: There is no context in which this conversion is possible -- End of Build -- 10:59:00 |