porting 3d modeling library

tim_mcd

Registered
I'm trying to port an open source 3d library which provides all the key modeling features needed for a basic cad system to OS X. The library in question is SvLis a Set-theoretic Kernel Geometric Modeler (http://www.bath.ac.uk/~ensab/G_mod/Svlis/svlis.html).

After some fiddling with the make file i can get the library and test programs to compile with c++. Several of the test programs run ok (happily calculating the surface area and volume, of object after boolean operations). When i attempt to run the graphical test programs (they use GLUT to output images) the program reports errors along the lines of NSAutoReleaseNoPool, then crashes.

The developers are helpful but seem to code mainly on straight unix machines with X11 for output to quote;

``I'm afraid that pressure of time means that I'm now really only supporting the Unix versions, and also I have almost 0 experience of Macs.''

Any idea what the problem may be or if i should post this message to an alternative list.

cheers

Tim
 
I'm new to Cocoa and Objective C, but the book I'm reading about the subject may me of some help. This is what I gather from the book, the NSAutoreleasePool is a memory management class that deallocates objects in the "pool" . For example, you want to return an object from a method, but you can't deallocate it before it's returned ... so what do you do? Add it to the NSAutoreleasePool. This makes sure the object is deallocated at the end of the event loop. As for your problem, maybe all Cocoa applications need an NSAutoreleasePool ... you could try it out ... try adding this to your code, in the main method ... <BR><BR>
NSAutoreleasepool * pool = [[NSAutoreleasePool alloc] init]];
<BR><BR>and at the end of the main method, before the return statement ...<BR><BR>[pool release];
 
Cheers for the reply, sorry i didn't get back sooner busy at work.

If only it was that easy.

The code is all C++ so "NSAutoreleasepool * pool ...." type commands shouldn't be needed (i did try them though), If you look at the /Developer/Examples/GLUTExamples/ you'll see that GLUT provides a platform independent way of producing 3d windows/images.

The files compile properly using c++ as opposed to cc in the make file but fail when they try to use any graphics procedures. i'm guessing c++ can't link objective-C frameworks. I anyone knows otherwise i would be happy to change my opinions.

The program doesn't link properly in project builder.

/usr/bin/ld: Undefined symbols:
__._10ostrstream
__._8ifstream
etc...


Even though i've included the following code in every file.

#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#include <strstream.h>

Any ideas what may be going wrong.

cheeers

Tim
 
Sorry the crocodiles ate the following text.

iostream.h, stdio.h, stdlib.h, OpenGL/gl.h, OpenGL/glu.h, GLUT/glut.h, strstream.h

tim
 
Back
Top