Building on Linux - crash on NewtonCreate()

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Building on Linux - crash on NewtonCreate()

Postby pHySiQuE » Thu Oct 31, 2013 4:38 pm

I am building Newton for Linux, inside a static library.

When I use Newton in a C++ executable on Linux, it works fine.

When I build Newton into a static library with the rest of my game engine, and then import the library into another executable, the executable crashes when run with a message "segmentation fault (core dumped)".

The crash occurs in NewtonCreate():
Code: Select all
NewtonWorld* NewtonCreate()
{
   TRACE_FUNCTION(__FUNCTION__);
   dgMemoryAllocator* const allocator = new dgMemoryAllocator();

   //============================================================
   NewtonWorld* const world = (NewtonWorld*) new (allocator) Newton (dgFloat32(1.0f), allocator); // crash occurs here
   //============================================================

   return world;
}


All preprcessor directives are the same in the standalone and static library builds. Any idea what could be wrong here?
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Building on Linux - crash on NewtonCreate()

Postby Julio Jerez » Thu Oct 31, 2013 4:46 pm

what do you mean inopot the library? libar do not get importerd thay are just a collection of .o files tha you link to.
In the demos I link the the .a libraries, in linux.

I will check this weekend, maybe soemtho is new .
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building on Linux - crash on NewtonCreate()

Postby pHySiQuE » Thu Oct 31, 2013 5:00 pm

My game engine is compiled as a static library. Newton is compiled into this as C++ code.

My editor imports the game engine static library when it is compiled.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm

Re: Building on Linux - crash on NewtonCreate()

Postby pHySiQuE » Thu Oct 31, 2013 6:17 pm

If there isn't something you already know, I would not worry about this. The problem is probably on my end. I just got the Code::Blocks debugger working and I will keep working on this myself. Thank you.
pHySiQuE
 
Posts: 608
Joined: Fri Sep 02, 2011 9:54 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests