Pergunta

I'm trying to use the code from this project from CodeProject:

http://www.codeproject.com/Articles/587629/A-Delaunay-triangulation-function-in-C

The problem is that the function which should be used in my project is:

WORD* BuildTriangleIndexList (void *pointList, float factor, int numberOfInputPoints, int numDimensions, int clockwise, int *numTriangleVertices)

which has a body inside the .cpp file, but no declaration in the header, so using the code as-is, I obviously get a compilation error complaining that it can't find the function.

So, I've tried to add the declaration to the header, and it compiles correctly, but the linker gave me:

Errore  1   error LNK2019: riferimento al simbolo esterno "unsigned short * __cdecl BuildTriangleIndexList(void *,float,int,int,int,int *)" (?BuildTriangleIndexList@@YAPAGPAXMHHHPAH@Z) non risolto nella funzione "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)  C:\Progetti\TestShader\TestShader\TutorialApplication.obj   TestShader

Thanks in advance.

Foi útil?

Solução

The function definition is missing, either you link with a library that has the definition of the function or define on your own, no other alternative. Suspect that the call is in C, so, wrap the definition as: extern "C" { // delclaration as well as definition both } Another possibility is that is it is C++ member function of a class, make sure all overridden member functions have an implementation (function body), if not put as pure virtual (abstract)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top