Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Makefile ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Makefile ?

On or about 6/25/02, Frederic Chausse wrote:
I WANT to develop under mac os X a classical way. I mean by typing make
under a Darwin terminal without using ProjectBuilder. I need to see
examples of makefiles.

My ultimate purpose is to adapt an OpenGL/GLUT user interface named glui
to be used by mac os X. It uses graphic request. I succeeded in
compiling but linking still fail : some (!) undefined symbols remains.

See the attached text file for make result.

What are the libraries I have to link with ? Where are they located ?

If there are no answer to that questions, I must have missed something.
So last question : where can I buy an efficient brain ?

Thanks to help me.

cc -I. -I../include -I../../GLUT/include -I/usr/include -I/usr/X11R6/include/ -L. -L/Users/chausse/Developpement/lib -L/usr/lib -L/usr/X11R6/lib/ -L/usr/local/lib -o example1 example1.o -lXmu -lXt -lXp -lXpm -lX11 -lXext -lSM -lICE -lgl -lglu -lglut -lglui
/usr/bin/ld: Undefined symbols:

First you have to decide exactly what it is you are trying to do. GLUT, the OpenGL Utility Toolkit provides an easy way to use OpenGL without having to deal with the details of the underlying windowing system. Thus you can use the same GLUT code with the X window system, Aqua, or other less cool window systems. Apple provides a GLUT framework, which you can use, as suggested by Jed Davis. If the code you are trying to build only uses GLUT and does not make X window system calls, this should be fine. The resulting application will run as a native Mac OS X application.

On the other hand, if your example relies on an X window system implementation of GLUT, you will need to get a GLUT library for the X window system. (Since you are linking with a ton of X libraries, this appears to be the case.) Apple's framework won't work for this. GLUT is not distributed as part of XFree86, although other OpenGL libraries are. You will likely want to get libglut from Fink or GNU-Darwin. In this case you will also likely want to remove -L/usr/lib from your link line so it does not supercede X11 versions of the various libraries which are listed later on the command line. All of the undefined symbols are parts of various Apple frameworks, which won't be needed when you get the appropriate non-Aqua versions of the libraries.

darwin-userlevel mailing list | email@hidden
Do not post admin requests to the list. They will be ignored.

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.