Questions about Newton 3.10 for my Purebasic/dx9 engine

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby mpz » Wed Apr 09, 2014 6:18 am

Hello to all,

i use the greate newton dynamics version 3.10 for my 3d engine i have made for Purebasic.
I have some questions and hope you can help me.

Info about my 3d engine with newton:
http://www.purebasic.fr/english/viewtop ... 27&t=43601

Here some Demos made with newton and Purebasic

Image

Image

Image

Question 1:
In Purebasic it is only possible to use dll files or a C lib. If i compile the 3.10 Sourcecode i can only
make a dll file or make a c++ lib. I use the dll file but want to use a static c lib in my engine. If i
use the c++ lib in Purebasic there comes very much error codes and can't be used.

Is it possible to create a static c x86 and x64 lib? Can anybody create the libs(x86 and x64) and send me them?
I have changed the source code but it doesnt work at all and i cant create them...

Question 2:
i have read about a nowton dynamics 3.12 version. Is it possible to get them for testcases?!?

Thanks for your help...
Greetings
Michael
mpz
 
Posts: 5
Joined: Thu Feb 20, 2014 8:54 am

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby Sweenie » Wed Apr 09, 2014 7:39 am

First I would recommend you download the latest version using svn instead.
http://code.google.com/p/newton-dynamic ... e/checkout
You can use TortoiseSVN for this if you prefer using a GUI to handle this stuff.

Then there should be a solution(project) under the packages folder called VisualStudio_2012_static_mt that should build you a static lib.(Given that you use Visual Studio)
I think the compiled lib will be placed under coreLibrary_300\projects\windows\project_vs2012\Win32\newton\release

Now I haven't used PureBasic but after reading the docs I suppose you use OpenLibrary when using DLLs and Import/EndImport when using libs.
They mention that Import/EndImport assumes that the calling convention is STDCALL but that you instead can use ImportC if using the standard C calling convention.
Have you tried using ImportC ?
Sweenie
 
Posts: 503
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby mpz » Wed Apr 09, 2014 9:21 am

Hello Sweeni,

thanks for you answer and the information about 3.12...

I use VSC2010 and if i use the "VisualStudio_2010_static_mt" file from 3.11 it comes an error message from VS:

Image

Is it possible to make me a lib for testing from the "VisualStudio_2012_static_mt" Project? Perhaps i can it test it in the evening with VS2012...

What have i done:
I have tested some compiled files and here an example for the error message. If i use "import" or "importc", all times it comes the same error message:

Image

if i use the newton.lib only the following error messages appears:

Image


With Pelles C you can make without problems a static lib for Purebasic ;)

Greetings
Michael
mpz
 
Posts: 5
Joined: Thu Feb 20, 2014 8:54 am

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby Julio Jerez » Wed Apr 09, 2014 1:33 pm

if i use the newton.lib only the following error messages appears:

if you are using static libraries, you need to link all of the library dependecies, I think the are: physics.lic, pthread.lib and core.lib

in the pass there was only one library because until Vs 2008, vidual studion ide had teh option to atach teh libaries dependencies to anoteh library
but VS 2010 and new version remove that iptiopn all together form the linker alone with lot uf oteh funtionality
It is one of my disapienet with VS 2010 and up.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby mpz » Thu Apr 10, 2014 11:09 am

Hello again,

here comes an little update:

i have create a lib fil with "VisualStudio_2012_static_mt" and if i import these lib in Purebasic it comes the error message:

"FAILIFMISMATCH:_MSC_VER=1700;ignored"

I find in the option i needed for my purebasic lib, but i cant compile it. It appears to much errors. Have anybody an idea and can help?

Greetings Michael

Image
mpz
 
Posts: 5
Joined: Thu Feb 20, 2014 8:54 am

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby Julio Jerez » Thu Apr 10, 2014 12:07 pm

you can no coupled with the option /tc, because that is only valid for c code.
basically the option /tc remove the naming decoration from class functions and the make impossible to compile in C++ classes.
Newton is a C++ internally.

however no c++ class is expoised, so you should be able to build the code as /tp and only the file Newton.cpp nee to be compiled as /tc

why do you get file mismatch error?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby mpz » Fri Apr 11, 2014 7:20 pm

Hi Julio,

* why do you get file mismatch error?
If i use the c++ static libs in Purebasic these kind of errors appears, see also:
http://www.purebasic.fr/english/viewtopic.php?f=7&t=57022&hilit=wrapper

* however no c++ class is expoised, so you should be able to build the code as /tp and only the file Newton.cpp nee to be compiled as /tc
I have tested this but i dont find a way to compile it.

Fred who makes Purebasic write these:
* The usual answer for this question is: no. You have to create small wrapper in C to expose the C++ functions you need, PB doesn't handle direct import.

Whow can i make a wapper for Newton.cpp or make a /tc for these file?!?

Have a nice weekend
Michael
mpz
 
Posts: 5
Joined: Thu Feb 20, 2014 8:54 am

Re: Questions about Newton 3.10 for my Purebasic/dx9 engine

Postby Julio Jerez » Fri Apr 11, 2014 8:27 pm

mpz wrote:Fred who makes Purebasic write these:
* The usual answer for this question is: no. You have to create small wrapper in C to expose the C++ functions you need, PB doesn't handle direct import.
Whow can i make a wapper for Newton.cpp or make a /tc for these file?!?

yes that is what these files are
c:\tmp\newton-dynamics\coreLibrary_300\source\newton\Newton.h
c:\tmp\newton-dynamics\coreLibrary_300\source\newton\Newton.cpp

you do not need to make a wraper, all funstion on theso files are C.
you only need to compile the three projects and only use the funtion on those two files above.

Even if you wrte a C wrapper, you still nee to link the three librraiues
Newton.lib, core.lib, physiocs.lib and pthread.lib

i just happen that Netwon.llib expost C functions.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests