PDA

View Full Version : Warning when compiling a glew program (glew Warning: .drectve `/DEFAULTLIB:"LIBCMT")



GermanGuy
08-28-2014, 01:42 AM
I tried linking the glew libary dynamic, but it didnt work.

This works for me, but I get a warning: Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized

my makefile looks like this:



CC=g++
main: main.o
$(CC) -c -o main.o main.cpp -I "\..\freeglut\include" -I"\..\glew\include"
$(CC) -o program.exe main.o -L "\..\freeglut\lib" -L"\..\glew\lib\Release\Win32" -lglew32s -lopengl32 -lfreeglut





#define GLEW_STATIC
#include <stdio.h>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include "math_3d.h"

GLuint VBO;

static void RenderSceneCB()
{
glClear(GL_COLOR_BUFFER_BIT);

glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);

glDrawArrays(GL_POINTS, 0, 1);

glDisableVertexAttribArray(0);

glutSwapBuffers();
}


static void InitializeGlutCallbacks()
{
glutDisplayFunc(RenderSceneCB);
}

static void CreateVertexBuffer()
{
Vector3f Vertices[1];
Vertices[0] = Vector3f(0.0f, 0.0f, 0.0f);

glGenBuffers(1, &VBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertices), Vertices, GL_STATIC_DRAW);
}


int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA);
glutInitWindowSize(1024, 768);
glutInitWindowPosition(100, 100);
glutCreateWindow("Tutorial 02");

InitializeGlutCallbacks();

// Must be done after glut is initialized!
GLenum res = glewInit();
if (res != GLEW_OK) {
fprintf(stderr, "Error: '%s'\n", glewGetErrorString(res));
return 1;
}

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

CreateVertexBuffer();

glutMainLoop();

return 0;
}