1

I am a newbie to linux. I just installed openGL on ubuntu and would like to tweak some of its source files I use in order to print certain results of some calculations done.

I found the header file I needed using:

cd /

sudo find . -name freeglut_std.h

I would like to find the corresponding source file. Which is freeglut_std.c I guess. I tried the same command:

sudo find . -name freeglut_std.c

But nothing was found. How can I find it so I can add a few printf's to the source file?

EDIT: this is the short tutorial I followed in order to install openGL: http://ubuntuforums.org/showthread.php?t=345177

0

Try making your search case insensitive, add in a wildcard and make it a little faster by specifying a likely directory:

sudo find /usr -iname freeglut*

This should be enough to find your files, I installed as follows:

sudo apt-get install freeglut3-dev

and the results of the search showed:

andrew@corinth:~$ sudo find /usr -iname freeglut*
[sudo] password for andrew: 
/usr/share/doc/freeglut3
/usr/share/doc/freeglut3-dev
/usr/share/doc/freeglut3-dev/freeglut.html
/usr/share/doc/freeglut3-dev/freeglut_logo.png
/usr/share/doc/freeglut3-dev/freeglut_user_interface.html
/usr/include/GL/freeglut_ext.h
/usr/include/GL/freeglut.h
/usr/include/GL/freeglut_std.h
andrew@corinth:~$ 

The list of files in the freeglut3-dev package can be seen here...

Mind you if you are after the actual freeglut*.c files you must download the uncompiled source:

sudo apt-get dpkg-dev
mkdir $HOME/Desktop/freeglut_source && cd $HOME/Desktop/freeglut_source
apt-get source freeglut

The *.c files will be in $HOME/Desktop/freeglut_source/freeglut-2.8.1/src:

andrew@corinth:~/Desktop/freeglut_source/freeglut-2.8.1/src$ ls
freeglut_callbacks.c             freeglut_misc.c
freeglut_cursor.c                freeglut_overlay.c
freeglut_display.c               freeglut_spaceball.c
freeglutdll.def                  freeglut_state.c
freeglut_ext.c                   freeglut_stroke_mono_roman.c
freeglut_font.c                  freeglut_stroke_roman.c
freeglut_font_data.c             freeglut_structure.c
freeglut_gamemode.c              freeglut_teapot.c
freeglut_geometry.c              freeglut_teapot_data.h
freeglut_glutfont_definitions.c  freeglut_videoresize.c
freeglut_init.c                  freeglut_window.c
freeglut_input_devices.c         freeglut_xinput.c
freeglut_internal.h              Makefile.am
freeglut_joystick.c              Makefile.in
freeglut_main.c                  templates
freeglut_menu.c
andrew@corinth:~/Desktop/freeglut_source/freeglut-2.8.1/src$

Hope that helps. To rebuild the package after your source code changes have a look here...

  • didn't work. It didn't find any source files – LandonZeKepitelOfGreytBritn Mar 6 '16 at 12:55
  • I have expanded my answer to show how the search goes on my own setup... – andrew.46 Mar 6 '16 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.