Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Installing freeglut and OpenGl

  1. #1
    Join Date
    Jan 2007
    Location
    Halifax, NS
    Beans
    5
    Distro
    Xubuntu 6.10 Edgy

    Arrow Installing freeglut and OpenGl

    This is a simple tutorial to show a new linux user (such as myself) how to setup freeglut and OpenGl.

    System used IBM T22 ThinkPad:
    mobile pentium 3 900mhz
    256mb ram
    20GB hd
    S3 Inc. 86C270-294 Savage/IX-MV (rev 13) video card

    OS: xubuntu 6.10

    I have just recently become a linux user and wanted to install freeglut to do my graphics assignments on my laptop. Although the install did not turn out to be very difficult it took me a while to do. So I have written this tutorial in case another young linux user comes along and decides he/she wants to install freeglut and OpenGL.

    **This tutorial assumes that you have your operating system installed and you have access to the internet**

    Steps:

    From a terminal

    1) sudo apt-get update

    -This will update your apt database to the most recent available packages.

    2) sudo apt-get install build-essential

    - This installs the necessary development tools for building source code.

    3) sudo apt-get install freeglut3-dev

    - This installs the development libraries and headers for freeglut.

    Your done! Extremely simple! However you must remember that when compiling you must add a '-lglut' as a comand line argument to gcc. If you don't it cannot find the library's and you will get undefined reference errors.

    example command line: gcc simple.c -lglut

    At this point if your program compiles and runs then you are finished. However the first time I tried to run mine I received a 'libGL warning: 3D driver claims to not support visual 0x42'. This error means I cannot display the required colors to run the program. In my case I had the most recent drivers for my video card. So I did some research on my monitor and found out it can display a color depth of 24 instead of the 16 it was set at. To fix this problem you must edit the /etc/X11/xorg.conf file as root and set the 'DefaultDepth 24'. Reboot and the problem is solved.

    This is my first post (and tutorial) on the ubuntuforums. If people feel that this tutorial is not needed they can feel free to remove it. If anyone wants to add anything related to freeglut or OpenGl please feel free.


  2. #2
    Join Date
    Dec 2008
    Location
    hyderabad, India
    Beans
    6
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Talking Re: Installing freeglut and OpenGl

    thank you, thank you, thank you!!!

  3. #3
    Join Date
    Feb 2009
    Location
    India
    Beans
    3
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Installing freeglut and OpenGl

    Thanks!! Just what i was looking for. Btw has anyone tried to compile the freeglut package manually because i tried that before this apt-get method and it spewed out errors. Please help me out.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Beans
    1,039
    Distro
    Ubuntu

    Re: Installing freeglut and OpenGl

    Quote Originally Posted by l3ftm1n0r View Post
    Thanks!! Just what i was looking for. Btw has anyone tried to compile the freeglut package manually because i tried that before this apt-get method and it spewed out errors. Please help me out.
    What errors? according to apt-get the package is there

  5. #5
    Join Date
    Jun 2010
    Location
    Ann Arbor, Michigan, USA
    Beans
    1,421

    Re: Installing freeglut and OpenGl

    Thanks Man!
    Steam: ubuntugamer( Add me ) | Gaming: Left 4 Dead 2, Metro Last Light, Assassin's Creed 4, Forced

  6. #6
    Join Date
    Aug 2010
    Beans
    1

    Re: Installing freeglut and OpenGl

    Previously I am using 9.04. It has installed a software called Autodoc. It requires freeglut. While upgrading to Ubuntu 10.04 LTS, all rpm files are disabled. I have again install freeglut. But while trying to run this software it shows following error.
    Try adjusting the vblank_mode configuration parameter.
    freeglut ERROR: Function <glutSolidSphere> called without first calling 'glutInit'.
    Can any one help to solve this?

  7. #7
    Join Date
    Oct 2010
    Beans
    1

    Re: Installing freeglut and OpenGl

    Those steps are very quick and very helpful. To go with that speed, it would be nice to have a simple.c to try compiling at the end instead of having to look around for examples that will work with the newly installed freeglut package.

  8. #8
    Join Date
    Sep 2010
    Location
    Guadalajara, Mexico
    Beans
    6

    Re: Installing freeglut and OpenGl

    Hey.

    I want to start working with GL, I'm a newbie here on that.
    Apparently i got a "code-test" to check if the packages are installed.

    Apparently all of them are! still, It gives me an error on the Terminal.

    This one:
    g++ -Wall -o cube main.cpp imageloader.cpp -lglut
    imageloader.cpp: In function ‘Image* loadBMP(const char*)’:
    imageloader.cpp:141: warning: suggest parentheses around ‘&&’ within ‘||’
    /tmp/ccenhiwc.o: In function `handleResize(int, int)':
    main.cpp.text+0x183): undefined reference to `gluPerspective'
    collect2: ld returned 1 exit status
    make: *** [cube] Error 1
    I'm probably overlooking something. Can you help me out?

  9. #9
    Join Date
    Jul 2006
    Beans
    30

    Re: Installing freeglut and OpenGl

    When I do the last step I get this error.

    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    freeglut3-dev : Depends: libglu1-mesa-dev but it is not going to be installed or
    libglu-dev
    E: Broken packages



    if I try this command

    sudo apt-get install libglu1-mes

    I get this.

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libglu1-mesa is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


    Any ideas?

  10. #10
    Join Date
    Nov 2010
    Location
    Toronto
    Beans
    5
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Installing freeglut and OpenGl

    @lsteamer


    I'm getting the same errors. I worked with those video tutorial's on window's and they all compiled fine. I really want to fix that.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •