Results 1 to 5 of 5

Thread: undefined reference to gl everything

  1. #1
    Guest

    undefined reference to gl everything

    Okay I'm working on my very first "hello world" OGL program and I keep getting compile errors:

    >undefined reference to `glClear'
    >undefined reference to `glutCreateWindow'

    etc.

    I've included GL/glut.h; what's my problem?

  2. #2

    Re: undefined reference to gl everything

    Make sure you link to opengl32.lib and glut32.lib.

    Nate http://nate.scuzzy.net

  3. #3
    Guest

    Re: undefined reference to gl everything

    Sorry, I should have said, I'm on a FreeBSD machine.

    Am I looking for something like
    $>gcc hello.c -lGL

    How do I check if I have the required files?

  4. #4
    Guest

    Re: undefined reference to gl everything

    Okay, I've found the librarys. They where hiding in the X11R6's lib folder.

    But which one do I need to include?

  5. #5
    Member Contributor
    Join Date
    Feb 2000
    Location
    Breda, Netherlands
    Posts
    57

    Re: undefined reference to gl everything

    Here's my Makefile:

    CCOPS = -c -g -Wall
    LINKS = -lglut -lMesaGLU -lMesaGL -lm -lX11 -lXext -lXmu
    LDPATH = -L/usr/lib -L/usr/X11R6/lib
    INCS = -I. -I/usr/include
    OBJS = main.o

    .cpp.o :
    g++ $(CCOPS) $(INCS) $<

    all: main

    main: $(OBJS)
    g++ $(OBJS) $(INCS) $(LDPATH) $(LINKS) -o $@

    clean:
    rm -f main *.o core

Similar Threads

  1. undefined reference
    By hcdoeko in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-09-2014, 12:34 PM
  2. undefined reference
    By saman_artorious in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-16-2013, 11:49 PM
  3. undefined reference to......
    By milton in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-02-2011, 08:33 AM
  4. undefined reference...
    By ronsimaschine in forum OpenGL: Windows
    Replies: 2
    Last Post: 04-11-2007, 07:47 AM
  5. Getting undefined reference to
    By in forum OpenGL: Linux
    Replies: 1
    Last Post: 02-26-2003, 10:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean