Binding OpenGL and gcc
Christina McQuirk
mcquirk2@illinois.edu
Mon Jun 1 11:33:00 GMT 2009
Hi,
I posted earlier about having problems linking opengle and dlls, but
now that is fixed (Thanx for your help!). However, now my code runs
without error, but no display window opens. I have transfered my code
to a lab-mate's computer and it runs and opens a display window, but
mine does not.
CODE BLOCK
#include <stdio.h>
#include <stdlib.h>
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <windows.h>
#include <math.h>
#include <vector>
#include <string>
#include <fstream>
//#include <GL/glut.h>
void display(void)
{
}
int main (int argc,char *argv[])
{
glutInit(&argc, argv);
glutCreateWindow(argv[0]);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
MAKEFILE BLOCK
CC = g++
CFLAGS = -Wall -O2 -fno-exceptions -fno-rtti -I/usr/X11R6/include
-I/usr/include/opengl
#LDLIBS = -lm -L spd/lib lspd
LDLIBS = -lm -L spd/lib -lspd -L/usr/local/lib -lgsl -lgslcblas -L/lib
-lglut -lGLU -lGL -DWIN32 -lglut32 -lglu32 -lopengl32 -L/usr/X11R6/lib
#MESALIBS = -lglui -lglut32 -lglu32 -lopengl32 -L/lib -lglui -L/usr/X11R6/lib
#LOADLIBS = -DWIN32 -lglut32 -lglu32 -lopengl32 -L/lib -lglut -lGLU -lGL
SRC = test_window.cpp\
OBJ = test_window.o\
TARGET = run
#all : $(TARGET)
$(TARGET) : $(OBJ)
$(CC) $(CFLAGS) $(D_CFLAGS) -o $@ $^ $(INLIBS) $(LDLIBS)
.cpp.o :
$(CC) $(CFLAGS) $(D_CFLAGS) $(INLIBS) -o $@ -c $<
.c.o :
$(CC) $(CFLAGS) $(D_CFLAGS) $(INLIBS) -o $@ -c $<
clean :
-@rm -f $(OBJ) $(TARGET)
BASH OUTPUT
[YOUR-7E1386FF39:~] >> make clean
[YOUR-7E1386FF39:~] >> make
g++ -Wall -O2 -fno-exceptions -fno-rtti -I/usr/X11R6/include -I/usr/include/open
gl -o test_window.o -c test_window.cpp
/usr/include/opengl/GL/glut.h:562: warning: 'int glutCreateMenu_ATEXIT_HACK(void
(*)(int))' defined but not used
g++ -Wall -O2 -fno-exceptions -fno-rtti -I/usr/X11R6/include -I/usr/include/open
gl -o run test_window.o -lm -L spd/lib -lspd -L/usr/local/lib -lgsl -lgslcblas
-L/lib -lglut -lGLU -lGL -DWIN32 -lglut32 -lglu32 -lopengl32 -L/usr/X11R6/lib
[YOUR-7E1386FF39:~] >>
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list