Results 1 to 4 of 4

Thread: OpenGL programming on Ubuntu

  1. #1
    Join Date
    Dec 2008
    Beans
    12

    Unhappy OpenGL programming on Ubuntu

    Hi everyone, I am new to using/programming on linux, have been using WinXP for 5yrs, I use the VC++ 2008 Express IDE on Windows. I came to know tat GCC is the compiler of choice for linux, anyway i need clear, detailed advise on compiling & developing C/C++ Based-OpenGL programs on ubuntu. I am poking around ubuntu for the last 6days without getting anything working, I am nearly depressed plz help.

    Five Questions:-

    1.How Can I set the environment variables for ubuntu & GCC?

    2.Where can i get the OpenGL headers, libraries for ubuntu?

    3.How to setup my dev environment under ubuntu? ( header/library file dirs )

    4.How to compile simple GLUT-Based OpenGL Programs under ubuntu?

    5.How to compile full-blown X11-Native windowing-based OpenGL programs on ubuntu?


    I thought SDL would be great on linux, but in their linux-downloads section there are only RPM-packages, where are the .DEB packages?

    I'd be very very thankful & happy if u can help me out atleast with some questions.

    Thank You very much for your help in advance.

  2. #2
    Join Date
    Oct 2007
    Location
    Fort Collins, CO, USA
    Beans
    480
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: OpenGL programming on Ubuntu

    1. Environment variables are set in a shell with "export name=value". They are not system-wide. They are only inherited by child processes. If you want them to be set for all logins you could set them in /etc/environment. That file is sourced by gdm.
    2. Use the apt-get command to get them. "sudo apt-get install freeglut3-dev libglew1.5-dev" Those have dependencies that will bring in packages like libgl-dev and libglu-dev.
    3. "sudo apt-get install build essential" will get gcc and make. Various packages have "*-dev" and "*-doc" packages for header files and documentation.
    4. "cc -g -o example example.c -lglut -lGL -lGLEW"
    5. Programs that use libX11 directly can be linked the same way as programs that use glut. Or you could drop linking with glut and list only the X11 libraries directly. You would want -lX11 and -lXext.

    SDL is available for ubuntu using "sudo apt-get install libsdl1.2-dev".

  3. #3
    Join Date
    Dec 2008
    Beans
    12

    Talking Re: OpenGL programming on Ubuntu

    Thank U so much stroyan, thank u. It really helped me a lot. Man Linux is challenging & equally interesting.

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Beans
    2,185
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: OpenGL programming on Ubuntu

    Quote Originally Posted by stroyan View Post
    "sudo apt-get install build essential" will get gcc and make. Various packages have "*-dev" and "*-doc" packages for header files and documentation.
    Note it's build-essential, not build <space> essential.
    "cc -g -o example example.c -lglut -lGL -lGLEW"
    Use gcc instead of cc.
    Ubuntu 12.04

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
  •