Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: compile help

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2005
    Posts
    9

    compile help

    Hello as with many, I'm new to Linux but old to programming. I've set the system up, installed mesa-6.3.2, followed setup instructions,used make install which has put the lib files (which have installed into /usr/local/lib and headers to /usr/local/include/GL (is this right)).

    I tried to compile using a simple make main in my projects directory. This contains a simple hello world programme. This works so I changed it to printf("hello world %d", GL_PROJECTION) and added #include <GL/gl.h>, this works so I know it's using the header file.
    Next I added a glMatrixMode(GL_PROJECTION); to test if the libary is being linked in. This produces

    g++ main.cc -o main
    /tmp/ccif6YAV.o(.text+0x25): In function 'main':
    main.cc:undefined reference to 'glMatrixmode'
    collect2: ld returned 1 exit status
    main:*** [main] Error1

    I've tried adding it to the path using
    export PATH=/usr/local/lib:/usr/local/include/GL:/usr/bin (for compiler)

    This has no effect, can anyone help please

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    656

    Re: compile help

    hmmm...typo?

    try glMatrixMode instead of glMatrixmode...

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2005
    Posts
    9

    Re: compile help

    Thanks found it have to use

    g++ -o main main.cc -I/usr/local/include -L/usr/local/lib -LGL

    Sorry I miss copied small m :s

Posting Permissions

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