using gcc with opengl

Hi, I am a computer science and electrical engineering student trying to learn opengl on the side with my teacher. We do not want to use visual studio express because microsoft just wants your cc and they are trying to kill opengl so there is no point to use their compiler. So we want to use Dev C++ gcc from the command line to compile code instead of vs. I have three books that I am using to learn opengl: opengl programming guide, opengl supper bible 5, and interactive computer graphics. I have been able to get code to compile with vs but we are not able to compile using Dev C++ gcc.

The first program that I am working with is from SB5. If you want the source code and include folders that I am using you can get them from the supper bible site: www.openglsuperbible.com/previous-editions/ 5th edition I am in chapter 2 triangle. I expect the command line to be something like this:

g++ -IF:\school\csci\opengl\SB5\Src\GLTools\include -IF:\school\csci\opengl\SB5\freeglut-2.6.0\include Triangle.cpp libglew32.a libfreeglut.a

I have put libglew32.a and libfreeglut.a in my working directory, and I still get a bunch of errors referencing lib files and if I take out the libglew32.a and libfreeglut.a from my command line I get the same error messages so it is for sure not linking to the correct libraries, so I have no idea what to do. Here is the code I am working with:


// Triangle.cpp
// Our first OpenGL program that will just draw a triangle on the screen.

#include <GLTools.h> // OpenGL toolkit
#include <GLShaderManager.h> // Shader Manager Class

#ifdef __APPLE__
#include <glut/glut.h> // OS X version of GLUT
#else
#define FREEGLUT_STATIC 
#include <GL/glut.h> // Windows FreeGlut equivalent
#endif

GLBatch triangleBatch;
GLShaderManager shaderManager;

///////////////////////////////////////////////////////////////////////////////
// Window has changed size, or has just been created. In either case, we need
// to use the window dimensions to set the viewport and the projection matrix.
void ChangeSize(int w, int h)
{
glViewport(0, 0, w, h);
}


///////////////////////////////////////////////////////////////////////////////
// This function does any needed initialization on the rendering context. 
// This is the first opportunity to do any OpenGL related tasks.
void SetupRC()
{
// Blue background
glClearColor(0.0f, 0.0f, 1.0f, 1.0f );

shaderManager.InitializeStockShaders();

// Load up a triangle
GLfloat vVerts[] = { -0.5f, 0.0f, 0.0f, 
0.5f, 0.0f, 0.0f,
0.0f, 0.5f, 0.0f };

triangleBatch.Begin(GL_TRIANGLES, 3);
triangleBatch.CopyVertexData3f(vVerts);
triangleBatch.End();
}



///////////////////////////////////////////////////////////////////////////////
// Called to draw scene
void RenderScene(void)
{
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);

GLfloat vRed[] = { 1.0f, 0.0f, 0.0f, 1.0f };
shaderManager.UseStockShader(GLT_SHADER_IDENTITY, vRed);
triangleBatch.Draw();

// Perform the buffer swap to display back buffer
glutSwapBuffers();
}


///////////////////////////////////////////////////////////////////////////////
// Main entry point for GLUT based programs
int main(int argc, char* argv[])
{
gltSetWorkingDirectory(argv[0]);

glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
glutInitWindowSize(800, 600);
glutCreateWindow("Triangle");
glutReshapeFunc(ChangeSize);
glutDisplayFunc(RenderScene);

GLenum err = glewInit();
if (GLEW_OK != err) {
fprintf(stderr, "GLEW Error: %s
", glewGetErrorString(err));
return 1;
}

SetupRC();

glutMainLoop();
return 0;
}

The second program I am working with is from OpenGl programming Guide 8th edition you can get the source code and include folders from here: www.opengl-redbook.com/ and I expect the command line to be something like this:

g++ -I…\include triangle.cpp LoadShaders.cpp libglew32.a libfreeglut.a -lopengl21 -lglu32 -lgdi32 -luser32 -lwinm

and that code that I am working with is this:


///////////////////////////////////////////////////////////////////////
//
// triangles.cpp
//
///////////////////////////////////////////////////////////////////////
#include <iostream>
using namespace std;
#include "vgl.h"
#include "LoadShaders.h"
enum VAO_IDs { Triangles, NumVAOs };
enum Buffer_IDs { ArrayBuffer, NumBuffers };
enum Attrib_IDs { vPosition = 0 };
GLuint VAOs[NumVAOs];
GLuint Buffers[NumBuffers];
const GLuint NumVertices = 6;

//---------------------------------------------------------------------
//
// init
//
void
init(void)
{
glGenVertexArrays(NumVAOs, VAOs);
glBindVertexArray(VAOs[Triangles]);
GLfloat vertices[NumVertices][2] = {
{ -0.90, -0.90 }, // Triangle 1
{ 0.85, -0.90 },
{ -0.90, 0.85 },
{ 0.90, -0.85 }, // Triangle 2
{ 0.90, 0.90 },
{ -0.85, 0.90 }
};
glGenBuffers(NumBuffers, Buffers);
glBindBuffer(GL_ARRAY_BUFFER, Buffers[ArrayBuffer]);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices),
vertices, GL_STATIC_DRAW);
ShaderInfo shaders[] = {
{ GL_VERTEX_SHADER, "triangles.vert" },
{ GL_FRAGMENT_SHADER, "triangles.frag" },
{ GL_NONE, NULL }
};
GLuint program = LoadShaders(shaders);
glUseProgram(program);
glVertexAttribPointer(vPosition, 2, GL_FLOAT,
GL_FALSE, 0, BUFFER_OFFSET(0));
glEnableVertexAttribArray(vPosition);
}

void
display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBindVertexArray(VAOs[Triangles]);
glDrawArrays(GL_TRIANGLES, 0, NumVertices);
glFlush();
}

//---------------------------------------------------------------------
//
// main
//
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA);
glutInitWindowSize(512, 512);
glutInitContextVersion(4, 3);
glutInitContextProfile(GLUT_CORE_PROFILE);
glutCreateWindow(argv[0]);
if (glewInit()) {
cerr << "Unable to initialize GLEW ... exiting" << endl;
exit(EXIT_FAILURE);
}
init();
glutDisplayFunc(display);
glutMainLoop();
}

If you have any information on how either of these programs could be compiled using gcc through the command line I would greatly appreciate it, thank you.

For that first code fragment, you’re going to need to link with the modules providing the interfaces defined in GLTools.h and GLShaderManager.h. That is, whatever libs or object files define GLBatch, GLShaderManager, shaderManager, triangleBatch, GLT_SHADER_IDENTITY, and gltSetWorkingDirectory. These are not OpenGL, GLUT, or GLEW symbols.

Also, add the following to the top of this module for completeness:


#include <stdio.h>
#include <GL/glew.h> 

What’s you’re goal here? Are you looking for some example code with few dependencies you can start from? What ideally would you like this example program to do?

All I am trying to do is compile opengl code using gcc through the command line, the only way I am able to do it right now is with visual studio express 2008 and I don’t want to use that.

Here is what happens right after I hit enter on the command line:

gl\SB5\freeglut-2.6.0\include libglew32.a libfreeglut.a
In file included from F:/school/csci/opengl/SB5/freeglut-2.6.0/include/GL/freeglut_std.h:121,
from F:/school/csci/opengl/SB5/freeglut-2.6.0/include/GL/glut.h:17,
from Triangle.cpp:11:
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:225: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:225: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:226: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:226: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:227: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:227: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:228: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:228: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:229: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:230: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:231: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:231: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:232: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:232: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:233: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:233: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:234: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:234: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:235: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:235: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:236: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:236: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:237: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:237: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:238: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:238: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:239: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:239: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:240: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:240: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:241: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:241: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:242: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:242: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:243: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:243: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:244: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:244: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:245: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:245: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:246: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:246: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:247: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:248: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:249: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:250: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:250: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:251: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:251: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:252: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:252: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:253: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:253: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:254: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:254: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:255: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:255: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:256: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:256: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:257: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:257: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:258: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:258: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:259: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:260: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:260: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:261: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:261: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:262: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:262: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:263: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:263: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:264: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:264: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:265: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:265: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:266: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:267: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:267: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:268: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:268: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:269: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:269: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:270: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:270: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:271: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:271: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:272: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:272: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:273: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:273: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:274: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:274: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:275: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:275: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:276: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:277: error: `GLAPI’ does not name a type

All I am trying to do is compile opengl code using gcc through the command line, the only way I am able to do it right now is with visual studio express 2008 and I don’t want to use that.

Here is what happens right after I hit enter on the command line:

In file included from F:/school/csci/opengl/SB5/freeglut-2.6.0/include/GL/freeglut_std.h:121,
from F:/school/csci/opengl/SB5/freeglut-2.6.0/include/GL/glut.h:17,
from Triangle.cpp:11:
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:225: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:225: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:226: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:226: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:227: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:227: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:228: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:228: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:229: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:230: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:231: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:231: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:232: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:232: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:233: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:233: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:234: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:234: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:235: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:235: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:236: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:236: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:237: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:237: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:238: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:238: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:239: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:239: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:240: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:240: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:241: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:241: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:242: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:242: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:243: error: expected constructor, destructor, or type conversion b
efore “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:243: error: expected ,' or;’ before “const”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:244: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:244: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:245: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:245: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:246: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:246: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:247: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:248: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:249: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:250: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:250: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:251: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:251: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:252: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:252: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:253: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:253: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:254: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:254: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:255: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:255: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:256: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:256: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:257: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:257: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:258: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:258: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:259: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:260: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:260: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:261: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:261: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:262: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:262: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:263: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:263: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:264: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:264: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:265: error: expected constructor, destructor, or type conversion b
efore “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:265: error: expected ,' or;’ before “void”
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:266: error: GLAPI' does not name a type C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:267: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:267: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:268: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:268: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:269: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:269: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:270: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:270: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:271: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:271: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:272: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:272: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:273: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:273: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:274: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:274: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:275: error: expected constructor, destructor, or type conversion b efore "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:275: error: expected,’ or ;' before "void" C:/Dev-Cpp/bin/../lib/gcc/mingw32/3.4.2/../../../../include/GL/glu.h:276: error:GLAPI’ does not name a type
C:/Dev-Cpp/bin/…/lib/gcc/mingw32/3.4.2/…/…/…/…/include/GL/glu.h:277: error: `GLAPI’ does not name a type

Can you give us a VALID reason for not wanting to? So far you’ve given reasons based on unfounded paranoia and OS-war zealotry. It’s just tools, they’re not worth getting so worked-up over.

Also - you’ve spammed cross-posts of this all over the forum. Please don’t do that. Once is enough.

A final word of advice: if you’d posted this on gamedev.net or a Stack Exchange site you would have been downvoted to oblivion (on the former you would have been even risking a permanent ban, I think). Coming in with a flamebait attitude backed up by an inability to use the tools you’ve chosen, and a religious rather than pragmatic reason for choosing those tools you’re unable to use – not good. Not good at all.

Hey idiot I gave you a valid reason, microsoft is try to kill opengl so why would I want to use their compiler? Because I don’t want to use VS is a valid enough reason jerk. I don’t see it getting replied to so I was trying to get a bigger audience. WTF is a flamebait attitude? Man you are a real asshole, you must be microsoft’s bitch troll. I don’t want to be a slave to microsoft so I want to use open source, open source always and forever. Tell me what is wrong with asking this question?

I am working with two professors from the University of Minnesota on this with 60 years of programming experience between them and they don’t how to do this, so saying “backed up by an inability to use the tools you’ve chosen, and a religious rather than pragmatic reason for choosing those tools you’re unable to use – not good.”, is a really dumb thing to say. I have been working with them every day for the last three months to do this and only after we exhausted all of our knowledge did I turn here. Would you like their email addresses so you can tell them what shitty programmers they are?

Wait are you an admin, ummm no. So stfu, I don’t care about your advice at all. Posted to both sites just for you.

But you are correct about one thing, the hackers code of ethics is my religion.

I don’t see it getting replied to so I was trying to get a bigger audience jerk.

WTF is a flamebait attitude? Man you are a real asshole

You must be microsot’s bitch troll.

Never a slave to corporations, open source always and forever.

Your statement becomes pretty ironic considering that you’re using gcc on Windows(R). I must say at this point that I am supporter of Free Software (the thing you call “Open Source”) and try to exclusively use Free Software for ideological reasons, but from reading your posts I get the impression you don’t really understand the philosophy of either. Your selective objection to some MS products appears to have no other reason than paranoia and OS-war zealotry. I suggest reading up on the links I posted.

There’s nothing wrong with the question, the real problem is you cross posting the same question all over the place.

[QUOTE=Amad3u5;1258552]Hey idiot … Because I don’t want to use VS is a valid enough reason jerk. … Man you are a real asshole, you must be microsoft’s bitch troll.

Wait are you an admin, ummm no. So stfu, I don’t care about your advice at all. Posted to both sites just for you.

But you are correct about one thing, the hackers code of ethics is my religion.
[/QUOTE]
:doh:

[QUOTE=Amad3u5;1258552]
I am working with two professors from the University of Minnesota on this with 60 years of programming experience between them and they don’t how to do this, so saying “backed up by an inability to use the tools you’ve chosen, and a religious rather than pragmatic reason for choosing those tools you’re unable to use – not good.”, is a really dumb thing to say. I have been working with them every day for the last three months to do this and only after we exhausted all of our knowledge did I turn here. Would you like their email addresses so you can tell them what shitty programmers they are?[/QUOTE]
60 years of programming experience? Who are you working with, Grace Hopper? Also, one thing you should have learned at university by now is that having a fancy degree doesn’t make you a supperior human beeing. At my university, I run into people with a doctors degree in CS who claim to be security experts and don’t know what an HTTP request looks like and at what layer to put the IP address in the OSI model, at a daily basis.
Also, knowing one programming language doesn’t automatically make you good at every programming language.

I guess there’s a lack of understanding of and experience with the C programing language here, as there obviously are some macros for calling conventions and what not used in glu.h that are not defined in your programm (remember, your compile log). Since you’re using Windows(R) (not wanting to be a Microsoft(R) slave of course), I guess they are in <windows.h>

This qualifies you to be banned on this site also!

microsoft is try to kill opengl

This is the greatest nonsense I’ve recently heard. What operating systems are you using? Windows? Period!
No other comments are necessary. Windows is currently the best environment to develop OpenGL programs.

I don’t want to be a slave to microsoft so I want to use open source, open source always and forever. Tell me what is wrong with asking this question?

That’s OK as long as you allow others to tell you their opinions. Especially if they have a much more experiences than you. At least, that’s the part of good manners.

I am working with two professors from the University of Minnesota on this with 60 years of programming experience between them and they don’t how to do this, so saying “backed up by an inability to use the tools you’ve chosen, and a religious rather than pragmatic reason for choosing those tools you’re unable to use – not good.”, is a really dumb thing to say.

You have problems on the start. The problems will be bigger when you come to some serious usage. As some others already told you no the Gamesdev, there is no support for your environment. It is irrational to develop something in the old and unsupported environment. Instead of insulting other people try to understand what they try to tell you. Have you ever heard about GL debugging and profiling tools? How many of them are supported by Dev C++?

I have been working with them every day for the last three months to do this and only after we exhausted all of our knowledge did I turn here. Would you like their email addresses so you can tell them what shitty programmers they are?

And some of us have several decades of serious programming and also teaching at the university (both graphics and programming). Do you think you are qualified to insult us with just three moths of working with whoever it is?

It is not easy to be a good programmer (or engineer) but it is even harder to be a good man. Please, consider your manner in the communication! It is a friendly advice. This is one of the best forums in the Universe about OpenGL. Instead of quarreling, try to learn something, and the advances will be inevitable.

If you guys aren’t smart enough to solve this problem or read don’t post and I am reporting all of you for being abusive and not helpful.

In my post above, I suggested including windows.h before glu.h, as it contains all the undefined macros used in glu.h

Have you already tried that, or are you too busy insulting people?

You can’t read.

Enough of the flames, all of you.

Amad, I’m not going to censor this discussion. Some topics are flamebait and you’ve not just been on the receiving end. I suggest you ignore the insults and focus on the meat of the advice given.

Visual Studio is a first class IDE. The developers at AMD and NVIDIA develop their windows platform OpenGL drivers using it. Move past the politics and use the best tools for the job on the platforms you use. John Carmack who’s done more for OpenGL on Windows than most uses Visual Studio. It’s all about productivity when you pick tools like this so start with the smart decision. It’s YOUR productivity you’re sacrificing, and this thread is only the first hit you’re taking to that productivity.

OpenGL is just another library, if you want to use it with any compiler it works the same way as all the other libraries you link to on Windows, so your question is more of a generic compilation issue rather than an OpenGL one.

Best of luck.

P.S.

From your link line: -lopengl21

Eh? You may want to double check that lib name.

Thank you very much for all your help.