我有一個編譯器錯誤,但我找不出原因。g ++沒有匹配的函數調用錯誤
的.HPP:
#ifndef _CGERADE_HPP
#define _CGERADE_HPP
#include "CVektor.hpp"
#include <string>
class CGerade
{
protected:
CVektor o, rv;
public:
CGerade(CVektor n_o, CVektor n_rv);
CVektor getPoint(float t);
string toString();
};
在.cpp:
#include "CGerade.hpp"
CGerade::CGerade(CVektor n_o, CVektor n_rv)
{
o = n_o;
rv = n_rv.getUnitVector();
}
錯誤消息:
CGerade.cpp:10: error: no matching function for call to ‘CVektor::CVektor()’
CVektor.hpp:28: note: candidates are: CVektor::CVektor(float, float, float)
CVektor.hpp:26: note: CVektor::CVektor(bool, float, float, float)
CVektor.hpp:16: note: CVektor::CVektor(const CVektor&)
CGerade.cpp:10: error: no matching function for call to ‘CVektor::CVektor()’
CVektor.hpp:28: note: candidates are: CVektor::CVektor(float, float, float)
CVektor.hpp:26: note: CVektor::CVektor(bool, float, float, float)
CVektor.hpp:16: note: CVektor::CVektor(const CVektor&)
通常的呻吟,像_CGERADE_HPP名在C++保留 - 有自動執行此。 – 2010-04-21 17:42:47
另一個通常的呻吟聲中沒有提供適用的源代碼,錯誤在CGerade.cpp的第10行,而只有前7行出現在問題中。 – 2010-04-21 17:50:00