得到這個錯誤,看起來像這些錯誤對於實例來說是相當獨特的,所有的問題似乎都引用了模板,事實並非如此。LNK 2019:無法解析的外部符號 - 沒有模板類
那麼我現在得到的是:
錯誤5錯誤LNK2019:解析外部符號? 「市民:類VEC 3 * __thiscall補丁:: bezCurveInterp(類曲線,浮動)」( bezCurveInterp @ Patch @@ QAEPAVVec3 @@ MM @ Z)參考函數「public:class Vec3 * __thiscall Patch :: bezPatchInterp(float,float)」中的Patch @@ QAEPAVVec3 @@ VCurve @@ M @ Z) C :\ Users \ Sara \ Documents \ Sp14 \ 184 \ Bezeir \ Project1 \ Bezier.obj Project1
提到的函數被定義爲因此bezier.cpp:
#include "Bezier.h"
Vec3* bezCurveInterp(Curve c, float u) {
Vec3* res = new Vec3[2];
return res;
}
在bezier.h我有(除其他外):
#ifndef BEZIER_H
#define BEZIER_H
#include "Primitives.h"
class Patch {
public:
Vec3* bezCurveInterp(Curve, float);
VEC3在 「Primitives.h」 定義:
#ifndef PRIMITIVES_H
#define PRIMITIVES_H
using namespace std;
// A class for representing Vec3s
class Vec3 {
public:
Vec3(); //among other things
};
而在 「Primitives.cpp」:
#include "Primitives.h"
Vec3::Vec3() {
x = 0;
y = 0;
z = 0;
}
什麼東西突出?幫助表示讚賞C++/Visual Studio是談到了將是一場噩夢..........
VEC 3 *'補丁':: bezCurveInterp (曲線c,浮點u) –