Building a GLFW app w/ GDC on a Mac

Max kaufmann max.kaufmann at gmail.com
Sat Oct 20 20:03:22 PDT 2007


Trying to build this app on a mac:

import glfw;

void main() {
        int running = 1;
        glfwInit();
        if (!glfwOpenWindow(300,300,0,0,0,0,16,0,GLFW_WINDOW)) {
                glfwTerminate();
                return 0;
        }
        glfwSetWindowTitle("GLFW - now in D!");
        glfwSwapInterval(0);
        while( running ) {
                glClear(GL_COLOR_BUFFER_BIT);
                glfwSwapBuffers();
                if (!glfwGetWindowParam(GLFW_OPENED)) {
                        running = 0;
                }
        }
        glfwTerminate();
}

I compiled using this command:

~/gdc/bin/gdc -I ~/src/dlib/ ~/src/dlib/*.d hello.d -lglfw -framework Carbon -framework AGL -framework OpenGL -o app

Initially ~/src/dlib/glfw.d was giving me compile errors because of two "const" parameters in line 344 and 347, so I just nixed those type specifiers, and it compiled fine, however now I'm getting the link error:

/usr/bin/ld: Undefined symbols:
__D2gl7glClearFkZv
collect2: ld returned 1 exit status

When I comment out the call to glClear() the app links fine and when I execute it I get the window I'd expect, but filled with garbage because there's nothing's clearing the buffers.

Has anyone else run into this problem?  I've read about people compiling glfw w/ gdc on a mac fine before, what am I doing wrong?



More information about the Digitalmars-d mailing list