Results 1 to 2 of 2

Thread: New to programming on Ubuntu

Hybrid View

  1. #1
    Join Date
    Dec 2007
    Beans
    28

    New to programming on Ubuntu

    I am an old timer with programming but have not done anything in years and years.
    I wanted to start it back up with C++ and OpenGl on Ubuntu.
    I have GCC and OpenGL installed and running as far as I know.
    When I run the tutorials from http://openglbook.com/, I can get past the first 3 chapters and run the tutorials.
    The output from Chapter1 shows: INFO: OpenGL Version 4.0.0 NVIDIA 319.23
    All of Chapter 1,2,&3 run fine.
    When I try to compile Chapter4 with "gcc -I/usr/include -L/usr/lib -lglut -lGL -lGLU -lGLEW Chapter4.c"
    I get the following errors:
    /tmp/cce06EGv.o:Chapter4.c:function Initialize: error: undefined reference to 'ExitOnGLError'
    /tmp/cce06EGv.o:Chapter4.c:function Initialize: error: undefined reference to 'ExitOnGLError'
    /tmp/cce06EGv.o:Chapter4.c:function Initialize: error: undefined reference to 'TranslateMatrix'
    /tmp/cce06EGv.o:Chapter4.c:function ResizeFunction: error: undefined reference to 'CreateProjectionMatrix'
    /tmp/cce06EGv.o:Chapter4.c:function CreateCube: error: undefined reference to 'ExitOnGLError'
    /tmp/cce06EGv.o:Chapter4.c:function CreateCube: error: undefined reference to 'LoadShader'
    /tmp/cce06EGv.o:Chapter4.c:function CreateCube: error: undefined reference to 'LoadShader'
    /tmp/cce06EGv.o:Chapter4.c:function CreateCube: error: undefined reference to 'ExitOnGLError'
    /tmp/cce06EGv.o:Chapter4.c:function DrawCube: error: undefined reference to 'DegreesToRadians'
    /tmp/cce06EGv.o:Chapter4.c:function DrawCube: error: undefined reference to 'RotateAboutY'
    /tmp/cce06EGv.o:Chapter4.c:function DrawCube: error: undefined reference to 'RotateAboutX'

    I have copied the Utils.* and Simple*.* files to the same directory.
    I do not know if they need special permissions or what.
    I would appreciate any ideas of suggestions.
    I usually use Geany, but tried with commandline and received the same results.

    How go I check and make sure my OpenGL and FreeGlut are installed correctly?

    THANKS
    Michael

  2. #2
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,237
    Distro
    Kubuntu

    Re: New to programming on Ubuntu

    List your source files before listing the libraries it depends on. For example:
    Code:
    gcc -I/some/include/path MySource.c -L/some/lib/path -lsomelib

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
  •