Setting Up Newton SDK in Visual Studio 6.0

Discussion about everything. New games, 3d math, development tips...
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Setting Up Newton SDK in Visual Studio 6.0

Post by BenFlowers »

Hi, I have newton SDK installed in the following directory : C:\Program Files\NewtonSDK\sdk And i cant get it linked up with visual studio. Here is a list of my included directories:
Image

Image

anyone know what i have done wrong?
Thanks in advance -BEN
rewb0rn
Posts: 15
Joined: Thu May 25, 2006 9:26 pm
Location: Berlin, Germany

Post by rewb0rn »

Dont know that SDK and maybe they solved this different to other SDKs, but normally you have to add a folder lib to Libary files and Include to include files, you added the folder DLL. If that is correct in this SDK, try to push the directories up to the start of the list.

But I am only guessing :)
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

I've tried all sorts of different combinations i cant get it to work. The file names arent like Irrlicht's though here is the filenames:
1.Custom Joints.
2.DLL,
4.DLL_Double
5.LIB_MT
6.LIB_MT_DOUBLE
7.LIB_ST
8.LIB_ST_DOUBLE

also the newton.h file is in this directory aswell

PS thanks for the quick reply
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Could you post your build log?
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

Hi Thanks for the reply: the output is:

Compiling...
main.cpp
C:\new\newton\main.cpp(2) : fatal error C1083: Cannot open include file: 'newton.h': No such file or directory
Error executing cl.exe.

the code is from the devc++ example :



Code: Select all

#include <Irrlicht.h>
#include "newton.h"

static NewtonWorld* nWorld;

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

int main()
{
   nWorld = NewtonCreate (NULL, NULL);
   IrrlichtDevice *device = createDevice(EDT_SOFTWARE,
                            dimension2d<s32>(640,480), false);

   IVideoDriver* driver = device->getVideoDriver();
   ISceneManager* smgr = device->getSceneManager();

   while(device->run())
   {
      driver->beginScene(true, true, video::SColor(0,0,0,0));
      smgr->drawAll();
      driver->endScene();
   }
   device->drop();
   return 0;
}

I know what the error is. Just not how to fix it :(
LOL
-ben
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

C:\new\newton\main.cpp(2) : fatal error C1083: Cannot open include file: 'newton.h': No such file or directory
You have specified "C:\Program Files\newtonsdk\sdk\dll" for the include path but I believe it should be "C:\Program Files\newtonsdk\sdk".
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

Thanks.
That allows it to compile, but when i execute it i get the following output in the plg file:

Linking...
main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreate
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

this is'nt my code as i stated earlier, and i havent had any practice in newton as ... i've been trying to get it to work all day :lol: so i dont know if its the actual code or still a linker error.

-BEN
rewb0rn
Posts: 15
Joined: Thu May 25, 2006 9:26 pm
Location: Berlin, Germany

Post by rewb0rn »

probably the same just for the libary folder..
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

i tried changing it and it hasnt worked :(.
but i tried just adding the newton.h into a peice of code and adding a newton parameter which does nothing and it compiled and it runs, so i think the error must just be in the code which the person has written. Thanks so mcuh for your help -BEN
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

BenFlowers wrote:Thanks.
That allows it to compile, but when i execute it i get the following output in the plg file:

Linking...
main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreate
Debug/main.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

this is'nt my code as i stated earlier, and i havent had any practice in newton as ... i've been trying to get it to work all day :lol: so i dont know if its the actual code or still a linker error.

-BEN
Have you told the project to link with newton.lib?

BTW Do any of the tutorials compile?
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

i just tried to compile the first tutorial it comes up with this error :
Compiling...
tutorial.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
c:\program files\newtonsdk\samples\tutorial_01_gettingstarted\stdafx.h(35) : fatal error C1083: Cannot open include file: 'Game.h': No such file or directory
Error executing cl.exe.



i must have to link like 5 things to it .... damn :lol:
-BEN
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

Try moving the Newton folder paths above Irrlicht (for both lib and include).
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

nope, same errors again. i wish newton had written a tutorial on how to make newton work! :lol: thanks for all this help BTW
-BEN
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

FWIW Tutorial1 compiles for me with VC8.

I'm wondering why the Newton tutorial is giving Irrlicht messages... Try reinstaiing the latest Newton SDK and try removing the extra folder paths from VC6.
BenFlowers
Posts: 18
Joined: Fri Nov 03, 2006 10:42 pm

Post by BenFlowers »

i think i may know what the problem is, i think the folder is missin "stdafx.h" which should be in the newton folder. Could you send the code over then ill save it and see if it works then... thanks.
-BEN
Post Reply