Correct way to use CNewton?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Correct way to use CNewton?

Postby MeltingPlastic » Fri Feb 07, 2014 11:44 pm

Hi all, I've been trying to get the CNewtonTutorial code working by linking against the Dll's.
I originally was using the plain c interface (and that worked fine). but now I cant get the CNewton interface to work...

I created a fresh project in Visual Studio 2013 and copied the CNewtonTutorial code to my main cpp file and set up the project to look in:

packages\projects\visualStudio_2012_dll\Win32\dNewton\release,
packages\projects\visualStudio_2012_dll\Win32\dJointLibrary\release,
coreLibrary_300\projects\windows\project_vs2012_dll\Win32\newton\releaseDll

for the libraries newton.lib, dNewton.lib, and dJointLibrary.lib.

But at compile time I keep getting these errors - any clue as to what I could be doing wrong?
Code: Select all
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewton::UpdateOffLine(float)" (__imp_?UpdateOffLine@dNewton@@UAEXM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall dNewton::~dNewton(void)" (__imp_??1dNewton@@UAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall dNewton::dNewton(void)" (__imp_??0dNewton@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl dNewtonAlloc::operator delete(void *)" (__imp_??3dNewtonAlloc@@SAXPAX@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void * __cdecl dNewtonAlloc::operator new(unsigned int)" (__imp_??2dNewtonAlloc@@SAPAXI@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewtonCollisionMesh::EndFace(void)" (__imp_?EndFace@dNewtonCollisionMesh@@UAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewtonCollisionMesh::AddFace(int,float const * const,int,int)" (__imp_?AddFace@dNewtonCollisionMesh@@UAEXHQBMHH@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewtonCollisionMesh::BeginFace(void)" (__imp_?BeginFace@dNewtonCollisionMesh@@UAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall dNewtonCollisionMesh::dNewtonCollisionMesh(class dNewton * const,__int64)" (__imp_??0dNewtonCollisionMesh@@QAE@QAVdNewton@@_J@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall dNewtonTransformLerp::InterplateMatrix(float,float * const)const " (__imp_?InterplateMatrix@dNewtonTransformLerp@@QBEXMQAM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall dNewtonTransformLerp::Update(float const * const)" (__imp_?Update@dNewtonTransformLerp@@QAEXQBM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall dNewtonCollision::~dNewtonCollision(void)" (__imp_??1dNewtonCollision@@UAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall dNewtonBody::GetMassAndInertia(float &,float &,float &,float &)const " (__imp_?GetMassAndInertia@dNewtonBody@@QBEXAAM000@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall dNewtonBody::SetLinearDrag(float)" (__imp_?SetLinearDrag@dNewtonBody@@QAEXM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall dNewtonBody::SetForce(float const * const)" (__imp_?SetForce@dNewtonBody@@QAEXQBM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void __thiscall dNewtonDynamicBody::SetBody(struct NewtonBody * const)" (__imp_?SetBody@dNewtonDynamicBody@@MAEXQAUNewtonBody@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall dNewtonDynamicBody::~dNewtonDynamicBody(void)" (__imp_??1dNewtonDynamicBody@@UAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall dNewtonDynamicBody::dNewtonDynamicBody(class dNewton * const,float,class dNewtonCollision const * const,void * const,float const * const,class dNewtonBody * const)" (__imp_??0dNewtonDynamicBody@@QAE@QAVdNewton@@MQBVdNewtonCollision@@QAXQBMQAVdNewtonBody@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewtonBody::OnContactProcess(class dNewtonContactMaterial * const,float,int)const " (__imp_?OnContactProcess@dNewtonBody@@UBEXQAVdNewtonContactMaterial@@MH@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall dNewtonBody::OnApplicationPostTransform(float)" (__imp_?OnApplicationPostTransform@dNewtonBody@@UAEXM@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall dNewtonCollisionSphere::dNewtonCollisionSphere(class dNewton * const,float,__int64)" (__imp_??0dNewtonCollisionSphere@@QAE@QAVdNewton@@M_J@Z)
1>main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall dNewtonAlloc::~dNewtonAlloc(void)" (__imp_??1dNewtonAlloc@@UAE@XZ)
1>C:\Users\Trevor Cash\Documents\Visual Studio 2013\Projects\PhysTest\Release\PhysTest.exe : fatal error LNK1120: 22 unresolved externals


Thanks in advance!
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Correct way to use CNewton?

Postby Julio Jerez » Sat Feb 08, 2014 1:09 am

The CNetwon Class is an all in one dll, the only library you need to link is CNewton.lib

To make it easier I added and new visual studio 2010 solution ../newton-dynamics\applications\tutorialsSDK300\CNewtonTutorials\newtonTutorialsDll.sln
this links to the CNewton DLL, and I think it is simple enough that you can figure out how to use it.

if you want to use the DLL set of library you can do it in tow ways,
1- open and build the solution, ..\newton-dynamics\packages\projects\visualStudio_2010_dll/build.sln
and you can either use environment variables, relative path, or copy the file to your project.
2-add the libraries projects as sub-project dependencies of your solution, and set the relative path.


sync to SVN so that you get the example using CNewton.dll
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Correct way to use CNewton?

Postby MeltingPlastic » Sat Feb 08, 2014 5:19 pm

Thanks Julio, It makes sense that the only lib needed is CNewton.lib - works great now!
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests