Newton requires a lot of work! help me!

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
ozrinaut
Posts: 28
Joined: Tue Sep 13, 2005 5:09 pm

Newton requires a lot of work! help me!

Post by ozrinaut »

When i addon Newton engine as described here:http://irrlicht.sourceforge.net/tut_newton.html , I get 0 erors, 0 warnings and it runs fine.

However, when i try and run some of the examples in the newton sdk I get a file not found error on "stdafx.h"

If i add this file form the download on the link[above] it gives even more errors - am i missing something?

/////

-i found a stdafx.h file in:
NewtonSDK\samples\toolBox , so i include it in my project

- i get a warning about a redeinition of stdlib.h in 2003tookit/include/

- i comment out exit in stdlib.h compile

- i get error about glut32.lib not found

- i include NewtonSDK\samples\gl into my linker

- both files form the tutorial compile now, and thin i try to rebuild...

- now i get a slew of errors :

Code: Select all

Switching to target: default
tutorial.cpp
Material.cpp
Linking console executable: irrlicht.exe
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonDestroy referenced in function "void __cdecl CleanUp(void)" (?CleanUp@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodyGetUserData referenced in function "void __cdecl PhysicsBodyDestructor(struct NewtonBody const *)" (?PhysicsBodyDestructor@@YAXPBUNewtonBody@@@Z)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetForce referenced in function "void __cdecl PhysicsApplyForceAndTorque(struct NewtonBody const *)" (?PhysicsApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodyGetMassMatrix referenced in function "void __cdecl PhysicsApplyForceAndTorque(struct NewtonBody const *)" (?PhysicsApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
Material.obj : error LNK2001: unresolved external symbol __imp__NewtonBodyGetMassMatrix
tutorial.obj : error LNK2019: unresolved external symbol "void __cdecl GetCursorPos(struct MOUSE_POINT &)" (?GetCursorPos@@YAXAAUMOUSE_POINT@@@Z) referenced in function "void __cdecl Keyboard(void)" (?Keyboard@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "int __cdecl dGetKeyState(int)" (?dGetKeyState@@YAHH@Z) referenced in function "void __cdecl Keyboard(void)" (?Keyboard@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetTorque referenced in function "void __cdecl BallCharacterApplyForceAndTorque(struct NewtonBody const *)" (?BallCharacterApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodyGetOmega referenced in function "void __cdecl BallCharacterApplyForceAndTorque(struct NewtonBody const *)" (?BallCharacterApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodyGetVelocity referenced in function "void __cdecl BallCharacterApplyForceAndTorque(struct NewtonBody const *)" (?BallCharacterApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
Material.obj : error LNK2001: unresolved external symbol __imp__NewtonBodyGetVelocity
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodyGetForce referenced in function "void __cdecl BallCharacterApplyForceAndTorque(struct NewtonBody const *)" (?BallCharacterApplyForceAndTorque@@YAXPBUNewtonBody@@@Z)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonReleaseCollision referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetMatrix referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetMassMatrix referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetForceAndTorqueCallback referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetTransformCallback referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetDestructorCallback referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetUserData referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetMaterialGroupID referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonWorldUnfreezeBody referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonBodySetAutoFreeze referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonCreateBody referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "public: __thiscall SpherePrimitive::SpherePrimitive(class dMatrix const &,float,float,float,int)" (??0SpherePrimitive@@QAE@ABVdMatrix@@MMMH@Z) referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonCreateSphere referenced in function "void __cdecl AddBallCharacter(void)" (?AddBallCharacter@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "unsigned int __cdecl dRand(void)" (?dRand@@YAIXZ) referenced in function "void __cdecl InitScene(void)" (?InitScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "public: __thiscall BoxPrimitive::BoxPrimitive(class dMatrix const &,class dVector const &,int)" (??0BoxPrimitive@@QAE@ABVdMatrix@@ABVdVector@@H@Z) referenced in function "void __cdecl InitScene(void)" (?InitScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonCreateBox referenced in function "void __cdecl InitScene(void)" (?InitScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "public: __thiscall LevelPrimitive::LevelPrimitive(char const *,struct NewtonWorld *,void (__cdecl*)(struct NewtonBody const *,struct NewtonBody const *,float const *,int,int,int const *))" (??0LevelPrimitive@@QAE@PBDPAUNewtonWorld@@P6AXPBUNewtonBody@@2PBMHHPBH@Z@Z) referenced in function "void __cdecl InitScene(void)" (?InitScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonCreate referenced in function "void __cdecl InitScene(void)" (?InitScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "void __cdecl Print(class dVector const &,float,float,char const *,...)" (?Print@@YAXABVdVector@@MMPBDZZ) referenced in function "void __cdecl DrawScene(void)" (?DrawScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "public: static class GraphicManager & __cdecl GraphicManager::GetManager(void)" (?GetManager@GraphicManager@@SAAAV1@XZ) referenced in function "void __cdecl DrawScene(void)" (?DrawScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "void __cdecl SetCamera(class dVector const &,class dVector const &)" (?SetCamera@@YAXABVdVector@@0@Z) referenced in function "void __cdecl DrawScene(void)" (?DrawScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol __imp__NewtonUpdate referenced in function "void __cdecl DrawScene(void)" (?DrawScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "public: float __thiscall CHiResTimer::GetElapsedSeconds(void)" (?GetElapsedSeconds@CHiResTimer@@QAEMXZ) referenced in function "void __cdecl DrawScene(void)" (?DrawScene@@YAXXZ)
tutorial.obj : error LNK2019: unresolved external symbol "void __cdecl InitOpenGl(int,char * *,char const *,void (__cdecl*)(void))" (?InitOpenGl@@YAXHPAPADPBDP6AXXZ@Z) referenced in function _main
tutorial.obj : error LNK2019: unresolved external symbol "public: __thiscall CHiResTimer::CHiResTimer(void)" (??0CHiResTimer@@QAE@XZ) referenced in function _$E1
tutorial.obj : error LNK2019: unresolved external symbol "public: __thiscall CHiResTimer::~CHiResTimer(void)" (??1CHiResTimer@@QAE@XZ) referenced in function _$E2
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetMaterialPairUserData referenced in function "int __cdecl GenericContactBegin(struct NewtonMaterial const *,struct NewtonBody const *,struct NewtonBody const *)" (?GenericContactBegin@@YAHPBUNewtonMaterial@@PBUNewtonBody@@1@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetContactTangentSpeed referenced in function "int __cdecl GenericContactProcess(struct NewtonMaterial const *,struct NewtonContact const *)" (?GenericContactProcess@@YAHPBUNewtonMaterial@@PBUNewtonContact@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetContactPositionAndNormal referenced in function "int __cdecl GenericContactProcess(struct NewtonMaterial const *,struct NewtonContact const *)" (?GenericContactProcess@@YAHPBUNewtonMaterial@@PBUNewtonContact@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetContactNormalSpeed referenced in function "int __cdecl GenericContactProcess(struct NewtonMaterial const *,struct NewtonContact const *)" (?GenericContactProcess@@YAHPBUNewtonMaterial@@PBUNewtonContact@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialContactRotateTangentDirections referenced in function "int __cdecl CharacterContactProcess(struct NewtonMaterial const *,struct NewtonContact const *)" (?CharacterContactProcess@@YAHPBUNewtonMaterial@@PBUNewtonContact@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialCreateGroupID referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialSetCollisionCallback referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialSetDefaultFriction referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialSetDefaultCollidable referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialSetDefaultElasticity referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialSetDefaultSoftness referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Material.obj : error LNK2019: unresolved external symbol __imp__NewtonMaterialGetDefaultGroupID referenced in function "void __cdecl SetupMaterials(struct NewtonWorld *)" (?SetupMaterials@@YAXPAUNewtonWorld@@@Z)
Process terminated with status 1 (0 minutes, 1 seconds)
52 errors, 0 warnings
 
HELP PLEASE! Newton is turning out to be a very difficult addon.
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

Clearly, you aren't linking the Newton library correctly, or you are linking the wrong one. I had trouble with a few of them, I think I ended up linking with the files in the 'dll' folder. Doublecheck that you are linking properly. As for "Stdafx.h" check that you aren't using precompiled headers
ozrinaut
Posts: 28
Joined: Tue Sep 13, 2005 5:09 pm

Post by ozrinaut »

pfo wrote:Clearly, you aren't linking the Newton library correctly, or you are linking the wrong one. I had trouble with a few of them, I think I ended up linking with the files in the 'dll' folder. Doublecheck that you are linking properly. As for "Stdafx.h" check that you aren't using precompiled headers
This has nothing to do with precomiled headers:

Code: Select all

NewtonSDK\samples\common\OpenGlUtil.h(16) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
NewtonSDK\samples\common\HiResTimer.h(12) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
(PS I'm not using *.PCH)

So should i not be including the samples dir maybe? ill try tht
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

All you should have to do is to link to the sdk folder for 'includes" and to the dll lib folder for your lib.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Guest

Post by Guest »

MikeR wrote:All you should have to do is to link to the sdk folder for 'includes" and to the dll lib folder for your lib.
I did and come of the nsdk files are including 'stdafx.h', which does not exist?
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

I think stdafx.h is MFC, it's for Visual Studio compilers. You don't want to include the toolbox folder that #$(^&* is a real pain to compile (I found out when compiling the Newton SDK) and it's really for manipulating a purely OpenGL display and integrating it with Newton. Just link with newton.lib and include Newton.h is all you should need.
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

lmfao reading the first post reminds me of the last year of my life.
ozrinaut
Posts: 28
Joined: Tue Sep 13, 2005 5:09 pm

Post by ozrinaut »

pfo wrote:I think stdafx.h is MFC, it's for Visual Studio compilers. You don't want to include the toolbox folder that #$(^&* is a real pain to compile (I found out when compiling the Newton SDK) and it's really for manipulating a purely OpenGL display and integrating it with Newton. Just link with newton.lib and include Newton.h is all you should need.
Some of the files in the NewtonSDK /samples/ folder have a

Code: Select all

#include <stdafx.h>
by default. There are other files it cannot find unles si inculde more sdk folders... which cause problems.... argh!

PS Like I've said, I am able to get the tutorial listed on Irrlicht website to compile and run - but none of the other examples.
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

stdafx.h
This file is not in the microsoft sdk. If you have dev-cpp, it's in there.
I haven't tried compiling the tutorials with that folder linked yet, so don't know if it will work when using msvc.

Edit to add:
Don't try that. It doesn't work.
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
vgmdev
Posts: 57
Joined: Sun Jan 09, 2005 7:32 pm
Location: USA, MI

Post by vgmdev »

stdafx.h is vc++ atuo gen. file. It just file the include files thats all.
Ozrinaut_guest

Post by Ozrinaut_guest »

vgmdev wrote:stdafx.h is vc++ atuo gen. file. It just file the include files thats all.
I don't think you understand - this is included within the file. ive said this already at least twice above...

I'm using code::blocks ... maybe ill setup devC++ and try that,..
Guest

Post by Guest »

no need to bro, the file should be in your Visual C++ Toolkit folder :wink:
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

ozrinaut wrote: Some of the files in the NewtonSDK /samples/ folder have a

Code: Select all

#include <stdafx.h>
by default. There are other files it cannot find unles si inculde more sdk folders... which cause problems.... argh!

PS Like I've said, I am able to get the tutorial listed on Irrlicht website to compile and run - but none of the other examples.
Why don't you use ODE instead of Newton ? It's obvious from this post that the Newton developer didn't even bother himself considering that some people may not wish to use a pirated M$ compiler. Any decent open source or freeware project should provide support for mingw and devcpp at minimum.
Post Reply