Initializer specified for static member

I get the following error. If you could help debug what is wrong that would be awesome.
initializer specified for static member function ‘static const csc350Lib_calculus_snle::SolutionNLE* csc350Lib_calculus_snle::NonlinearSolver::solve(csc350Lib_calc_base::Function1D*, float, float, float)’


Here is the code:
NonLinearSolver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef NONLINEARSOLVER_H
#define	NONLINEARSOLVER_H

#include "Function1D.h"
#include "SolutionNLE.h"

using namespace csc350Lib_calc_base;
namespace csc350Lib_calculus_snle
{
    class NonlinearSolver
    {
    public:
        NonlinearSolver(void);
        virtual ~NonlinearSolver(void);
        static const SolutionNLE* solve(Function1D* f, float a, float b, float tol) = 0;
        //This is a pure abstract method that should be implemented by subclasses.
        //The parameters are a pointer to the NLE's function, the endpoints of the search's bracket,
        //and the tolerance of the search. The function (again, implemented by the subclasses) should
        //return a pointer to a SolutionNLE object.
    private:
    };
}

#endif	/* NONLINEARSOLVER_H */ 

NonLinearSolver.cpp
1
2
3
4
5
6
7
8
9
10
11
#include "NonLinearSolver.h"

using namespace csc350Lib_calculus_snle;

NonlinearSolver::NonlinearSolver(void)
{
}

NonlinearSolver::~NonlinearSolver(void)
{
}


Any help would be so appreciated!
the function is wrong to be a pure abstract method;

It needs to be declared virtual and the static keyword would have to go.
Why are you trying to create a static pure virtual method?
(Totally aside from the real problem, consider either not providing a default constructor or destructor, or, if you must (say due to a virtual method), then move the (empty body) implementation to the header file.
Topic archived. No new replies allowed.