views:

155

answers:

2

Hi,

I am rather new to Mac OSX. I am trying to get an old code compiled in OSX Leopard, which uses OpenGL and XM. The headers are like:

#include <malloc.h>      
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/keysym.h>
#include <Xm/MainW.h>
#include <Xm/RowColumn.h>
#include <Xm/PushB.h>
#include <Xm/PushBG.h>
#include <Xm/CascadeB.h>
#include <Xm/CascadeBG.h>
#include <Xm/Form.h>
#include <Xm/Frame.h>
#include <GL/GLwMDrawA.h>
#include <GL/gl.h>
#include <GL/glx.h>
#include <Xm/Label.h>
#include <Xm/LabelG.h>
#include <Xm/PanedW.h>
#include <Xm/Text.h>
#include <Xm/List.h>
#include <Xm/SeparatoG.h>
#include <X11/Xlib.h>   
#include <Xm/TextF.h>

I wonder if you think I will get problems trying to compile it on OSX. If not, should I use the last libraries or older versions? The fact is that I just got the source code, not documentation. Where would you exactly get these libraries from?

Thanks

+1  A: 

First, on OSX, to include OpenGL headers, you need to include:

#include <OpenGL/gl.h>

and not:

#include <GL/gl.h>

Then, you need to specify OpenGL in the list of frameworks you will use. As for Xm, I don't use it, but as long as the framework is called Xm, then you're good.

PierreBdR
thanks. where can I find detailed information about exactly what a "framework" is? and as for openGL, shoud I install it from root or install it wherever and later link it at the compilation and linking stage?
Werner
You do not need to install OpenGL separately from XCode and X11. Use the version that comes with the system. A 'Framework' is a kind of library, and for your purposes the main difference is the command line to the linker. Very carefully read the linker documentation for OS X and whichever Unix this app came from, because they're going to be quite different and you will need to change the Makefile. You will have to get Motif, as the other answer says.
Andrew McGregor
+1  A: 

The Xm stands for the X/Motif libraries. Have a look here for a Mac OS X version.

epatel