Building a GLFW app w/ GDC on a Mac (SOLVED)
Max Kaufmann
max.kaufmann at gmail.com
Sun Oct 21 15:53:06 PDT 2007
Figured it out. Just needed to replace:
version(Win32)
extern(Windows):
version(linux)
extern(C):
with
version(Win32)
extern(Windows):
else
extern(C):
I'll send a note about it to the GLFW dev guys to about the mod.
Max kaufmann Wrote:
> 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