dAssert (0); - dNewton

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

dAssert (0); - dNewton

Postby Slick » Wed Apr 22, 2020 9:11 am

I get a crash in newton.cpp at line 105.

The line in questions is:
Code: Select all
dAssert (0);


I just built using Cmake and the only change I made was to chamge the cmakelists.txt as follows:
Line 109 was:
if(NEWTON_STATIC_RUNTIME_LIBRARIES)
message ("link to static runtime libraries")
set(CMAKE_C_FLAGS_DEBUG "/MTd")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MT")
set(CMAKE_C_FLAGS_RELEASE "/MT")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT")
set(CMAKE_CXX_FLAGS_RELEASE "/MT")

Now changed to:
if(NEWTON_STATIC_RUNTIME_LIBRARIES)
message ("link to static runtime libraries")
set(CMAKE_C_FLAGS_DEBUG "/MDd")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD")
set(CMAKE_C_FLAGS_RELEASE "/MD")
set(CMAKE_CXX_FLAGS_DEBUG "/MDd")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD")
set(CMAKE_CXX_FLAGS_RELEASE "/MD")


That may be unrelated but since it is a new project I don't know.

I am linking statically which is why I changed the Cmake as above.

Any ideas?
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: dAssert (0); - dNewton

Postby Slick » Wed Apr 22, 2020 9:15 am

OK maybe I worked it out. It looks to me like an assertion is intentionally being thrown maybe for testing? However, this is the live version in github.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: dAssert (0); - dNewton

Postby JernejL » Wed Apr 22, 2020 9:31 am

there are often asserts in live versions, build a release versions or just comment them out.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: dAssert (0); - dNewton

Postby Slick » Thu Apr 23, 2020 1:35 am

I commented it out and as expected it works. The part that I don't understand is that this will always fall if assertions are on.
Slick
 
Posts: 330
Joined: Sat Feb 07, 2004 7:24 pm
Location: LA last and France now

Re: dAssert (0); - dNewton

Postby Sweenie » Thu Apr 23, 2020 9:30 am

Julio usually adds a dAssert(0) when implementing something new or if a function isn't fully implemented etc.
It's seems he intended to add some transform functionallity to the dNewton class but never got around to it and just forgot to remove the assert.
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 23 guests