Pregunta

Getting this error, looks like these errors are fairly unique to instance and all of the questions seemed to reference templates, and this does not.

So what I'm getting is:

Error 5 error LNK2019: unresolved external symbol "public: class Vec3 * __thiscall Patch::bezCurveInterp(class Curve,float)" (? bezCurveInterp@Patch@@QAEPAVVec3@@VCurve@@M@Z) referenced in function "public: class Vec3 * __thiscall Patch::bezPatchInterp(float,float)" (?bezPatchInterp@Patch@@QAEPAVVec3@@MM@Z) C:\Users\Sara\Documents\Sp14\184\Bezeir\Project1\Bezier.obj Project1

The function mentioned is defined as thus in bezier.cpp:

#include "Bezier.h"

Vec3* bezCurveInterp(Curve c, float u) {
    Vec3* res = new Vec3[2];
    return res;
}

In bezier.h I have (among other things):

#ifndef BEZIER_H
#define BEZIER_H
#include "Primitives.h"

class Patch {
public:
    Vec3* bezCurveInterp(Curve, float);

Vec3 is defined in "Primitives.h":

#ifndef PRIMITIVES_H
#define PRIMITIVES_H

using namespace std;
// A class for representing Vec3s

class Vec3 {
public:
    Vec3(); //among other things
 };

And in "Primitives.cpp":

#include "Primitives.h"

Vec3::Vec3() {
    x = 0;
    y = 0;
    z = 0;
}

Anything standing out? Help is appreciated c++/visual studio is turning out to be a nightmare..........

¿Fue útil?

Solución

You are missing Patch:: from bezCurveInterp

Vec3* Patch::bezCurveInterp(Curve c, float u)
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top