Notifications
Clear all

[Closed] C++ MNMesh Missing Lib ??

Hi, I am using MNMesh to create Verts to a empty PolyObject. But as soon as I create the vert using NewVert, I am getting a LNK2019 Error. I believe I must be missing a Lib of some sort but not sure. Code just in case :

Object *BlankObject = (Object*) ip->CreateInstance(GEOMOBJECT_CLASS_ID, EPOLYOBJ_CLASS_ID);
  	INode *newNode = ip->CreateObjectNode(BlankObject);
  	PolyObject *newObj = PolyObjectFromNode(newNode, t);
  	MNMesh* mm = NULL;
  
  		Point3 direction = Normalize(RandPoint[1] - RandPoint[0]);
  
  		 Point3 v[4] = {
  			Point3(RandPoint[0].x, RandPoint[0].y, 0.0f),
  			Point3(RandPoint[0].x + (Remainder * direction.x), RandPoint[0].y + (Remainder * direction.y), 0.0f),
  			Point3(RandPoint[0].x + (Remainder * direction.x), RandPoint[0].y + (Remainder * direction.y), 5.0f),
  			Point3(RandPoint[0].x, RandPoint[0].y, 5.0f)
  		};
  
  		mm->NewVert(v[0]);
 error LNK2019: unresolved external symbol "public: int __cdecl MNMesh::NewVert(class Point3 &)" (?NewVert@MNMesh@@QEAAHAEAVPoint3@@@Z) referenced in function "public: virtual void __cdecl PolyTools::CreateQuadPoly(void)" (?CreateQuadPoly@PolyTools@@UEAAXXZ)

Anyone know how I can fix this ?? I’ve tried a few things, like changing the code but I get this error each time!

7 Replies

it would crash anyway

MNMesh* mm = NULL;
  
  ....
  mm->NewVert(v[0]);

but other wise

Note: You must #include “MNMATH.H” to use this class as it’s not included by default by MAX.H. and then mnmath.lib should be added to the linker dependencies

Ok, is it because the MNMesh is NULL ? As i’ve also done it like this:
MNMesh* mm = &newObj->GetMesh();
But im still getting that LNK2019 Error …

Edit*: I have already got mnmath.h included within my code, but still getting the error ?? Do I need to add anything to the Project files ??

 lo1

You also need to include MNMath.lib in your linker input.

Thank you ! the error is now gone !!

You also need to include MNMath.lib in your linker input.

I did say that but he didn’t bother reading it.

 lo1

I must admit I also only saw you wrote that after posting my reply.

Sorry, tbf, I thought you meant that after I include the mnmath.h file, that the Lib file will automaticly be included. Not that I have to include it myself. Didn’t mean to be rude or anything, just how I saw it.