Advertisement

Using GLUT on linux...

Started by July 09, 2003 11:23 PM
3 comments, last by cowsarenotevil 21 years, 4 months ago
Ok, I''m feeling progressivly dumber each hour, but that''s ok. I''ve noticed that on windows, they always have the DLLs and stuff packed up nicely and you just extract them and everything works, but on linux, all I find is source distributions. Why is this? I''m still getting the hang of how binaries are handled on linux, so I know this is probably a realy dumb question. Thank you for your patience.
-~-The Cow of Darkness-~-
Binaries are normally handled through RPMs or some other package format anymore. The package formats normally track dependencies, which are meant to make sure you actually have everything you need to have to use the files within the package. The dependencies tracking is useful since, to reduce waste, files and libraries are shared and reused commonly much more so than in the Windows world. If you''re building from source, autoconf or your compiler will end up complaining if you don''t have everything you need to, but there needed to be a seperate mechanism for binaries, hence the package formats.

If the project doesn''t supply a package, your distro probably will. There are lots of tools to automatically create various packages from other package formats or from source available too.

Advertisement
I''m not sure you understood what I''m asking. I just want to know what to do with the linux source code for GLUT. Shuld I try to compile it before using it in my projects, or should I add the source, or what? I have no clue what I''m doing...
-~-The Cow of Darkness-~-
All you need to use GLUT in your project are its libraries and headers. Packages for libraries are normally split up into two parts: one for use by already built programs and one that contains anything else need to develop software using that library.

Only worry about GLUT on your own system, you don''t (normally) have to supply it to the end-users of your source or binaries (that''s their issue, to be handle however they''d like to handle it).

If you don''t have GLUT installed, you can probably install it in one of a couple ways without needing to touch the source code.

RedHat, Mandrake, SuSE (or something based on one of them): find a GLUT RPM (probably on the CD or the company''s server) and install it. You''ll also need a ''dev'' RPM for the GLUT headers and such. For Red Hat, these packages are called glut-3.7-12.arch and glut-devel-3.7-12.arch (and have the extension .rpm).

Debian: apt-get install libglut3 libglut3-dev.

Other distributions have thier own methods (just ask or check the distro''s website for more information).

Now, if you want to install it from source (which would normally install everything, headers and all), this is what you normally do for GNU-style projects (not every project uses the GNU build tools, but most do):
$ cd /path/of/extracted/source
$ ./configure --prefix=/some/prefix
(If it complains that it can''t find ./configure, try ./autogen.sh first. The normal prefix is /usr or possibly /usr/local, depending upon how your system is setup.)
$ make
$ su
(Enter password.)
# make install
# exit

So, in summary:
With a package based distribution: install a lib package and a lib-dev package.
With a non-package based distribution: build from source and install.
Afterward: simply link to the libraries that you need however their docs tell you to (some use ?-config scripts, many use pkg-config, some are manually linked).

That better?

Ok, that makes much more sense. I installed redhat yesterday(aside from using version 6 breifly and then getting bored), so I really have no clue what I''m doing. Thank you!
-~-The Cow of Darkness-~-

This topic is closed to new replies.

Advertisement