i try to call a function from a commercial program, i have the following on my header file:
1 2 3 4 5 6 7 8 9 10
class MYPACKAGE_API MyComputeThreshold1 : public HxCompModule
{
HX_HEADER(MyComputeThreshold1); // required for all base classes
public:
virtualvoid compute();
};
then the following produces an error:
1 2 3 4 5 6 7 8 9 10 11 12
void MyComputeThreshold1::compute()
{
#include <mclib/McDelaunay.h>
McVec2f* Points = new McVec2f[ nPoints ];
// some code to get the coordinates
McDArray<McDelaunay::Triangle> triangles;
int dummy = McDelaunay::triangulate2D(Points, nPoints, triangles);
}
This gives:
1>.\MyComputeThreshold1.cpp(113) : error C2352: 'McDelaunay::triangulate2D' : illegal call of non-static member function
Now there is not much i dare to do to the header file this command is introduced, so how should i change my code to cope with this??
McDArray<McDelaunay::Triangle> triangles;
int dummy = McDelaunay::triangulate2D(Points, nPoints, triangles);
This McDelaunay::triangulate2D(Points, nPoints, triangles); is an attempt to call a class function without actually going via an object of that class - you can't do this unless that function has been declared static. You have to call such a function via an instance of the class. Create an instance of the McDelaunay class and use that.