[padawan]NewtonCreate does not take 2 arguments ?(solved)

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

[padawan]NewtonCreate does not take 2 arguments ?(solved)

Postby noals » Mon Sep 03, 2012 8:22 am

hi,

im trying to use newton with irrlicht following a (french) tuto on the net
http://www.jeux-libres.com/tutoriaux/tuto-245-irrlicht-newton.php
and got this error message from the visual c++ express 2010 compiler.
Code: Select all
1>------ Build started: Project: Server1, Configuration: Release Win32 ------
1>  main.cpp
1>main.cpp(22): error C2660: 'NewtonCreate' : function does not take 2 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

through if i check the wiki, it does take 2 arguments, like in the tuto anyway
so i dont understand where the problem come from since im a beginner.


starting of my main.cpp
Code: Select all
#include <cstdlib>
#include <iostream>
#include <irrlicht.h>
#include <newton.h>

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

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

int main()
{
   NewtonWorld* world = NewtonCreate(0,0);  //init newton
   


any suggestion ?
Last edited by noals on Tue Sep 11, 2012 6:22 pm, edited 3 times in total.
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby Julio Jerez » Mon Sep 03, 2012 9:36 am

if you are in latest core 200 the function is
NewtonBody* NewtonCreateBody (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, const dFloat* const matrix);

in core 300
NewtonBody* NewtonCreateDynamicBody (const NewtonWorld* const newtonWorld, const NewtonCollision* const collision, const dFloat* const matrix);
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby carli2 » Mon Sep 03, 2012 10:23 am

NewtonCreate was splitted into two functions in core300

Code: Select all
        NEWTON_API void NewtonSetMemorySystem (NewtonAllocMemory malloc, NewtonF
reeMemory mfree);

        NEWTON_API NewtonWorld* NewtonCreate ();
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 10:39 am

im using newton-dynamics-2.36 so core 200

and what about NewtonCreate ?
i need it to initialize my NewtonCreateBody first argument right ? so how can i do ?

i tryed that :
Code: Select all
NewtonWorld*world=NewtonCreate();
   NewtonBody*body1 ;
   body1 = NewtonCreateBody(world,NewtonCreateBox(world,1,1,1,0,0),0) ;


it return me that :
Code: Select all
1>------ Build started: Project: Server1, Configuration: Release Win32 ------
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreate
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateBody
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateBox
1>D:\CREA4\Projets\Server1\Release\Server1.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


if i check the net it seem its a compiler linking error, another link tell me that it could be a "character set" problem and my project is set as "Not Set" because it is configured to use RakNet as well, could it be the source of my problem ?

edit : no, i tryed as well and got those unresolved external symbol error
i think i set the compilaion well but im maybe wrong.
for newton i just add the directories include with newton.h and the directory lib with newton.lib and set those in my configuration diretory/VC++ directories inclue & lib...



i will try core 300.
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 12:44 pm

its maybe because i didnt do that
Note: you need to download the latest verion of Newton and set an enviromnet variable name NEWTON_HOME to point to where the newton engine SDK is in you disk.
A typical enviroment varaibel looks like this:
NEWTON_HOME=C:\Newton_200\NewtonSDK\sdk


trying... thx for your replies anyway.
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 1:16 pm

now i have an error that i didnt have before.
1>------ Build started: Project: Server1, Configuration: Release Win32 ------
1> main.cpp
1>main.cpp(2): fatal error C1083: Cannot open include file: 'cstdlib': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


its like visual c++ forgot the basic c++ library after having set the newton environment.
not sure i did it well through.
Image
i put it in the 2 windows, it shouldnt be a problem right ?
edit : well i did it wrong but i corrected it i think.
top window adding it in PATH my stuff; C:\Program Files\Microsoft Visual Studio 10.0\SDK\Newton\source
bottom window NEWTON_HOME C:\Program Files\Microsoft Visual Studio 10.0\SDK\Newton\source
my problem is still the same through.

anyway, could anyone help me to compile or set well my environment ?


edit : i guess i delete the visual c++ path when trying to add the newton one at my first try damn...
aaaahhh i hate those stuff brb ! ^^
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 2:11 pm

ok, could someone using visual c++ express 2010 tell me the content of his PATH line in the environment variable ?
i overwrited mine... :oops:

edit : trying to reinstall it dont fix it
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 3:52 pm

ok, i fixed it anyhow including everthing manualy but it seem i did something wrong again because i still got the same error from the compilation.
Code: Select all
1>------ Build started: Project: Server1, Configuration: Release Win32 ------
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreate
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateBody
1>main.obj : error LNK2001: unresolved external symbol __imp__NewtonCreateBox
1>D:\CREA4\Projets\Server1\Release\Server1.exe : fatal error LNK1120: 3 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


any suggestion ?
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby carli2 » Mon Sep 03, 2012 4:38 pm

Can you please move these questions to a C++, Visual Studio or padawn forum? They are not really related to newton. It seems that you are not skilled enough to get a static or dynamic library link into you project.
carli2
 
Posts: 157
Joined: Thu Nov 10, 2011 1:53 pm

Re: [padawan]NewtonCreate does not take 2 arguments ?

Postby noals » Mon Sep 03, 2012 5:01 pm

get a static or dynamic library link into you project

thx !

reading your answer helped me to fix my problem, i just had to add it in the linker options like in the RakNet tuto.
sorry, its just that i lack experiences.
noals
 
Posts: 32
Joined: Mon Sep 03, 2012 7:59 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest