Compiling a C/C++ application against OpenGL and Xm in OSX
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
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.
The Xm
stands for the X/Motif libraries. Have a look here for a Mac OS X version.
精彩评论