lundi 20 avril 2015

Can't compile GLUT helloworld with MinGW

I'd like to setup OpenGL libraries and run a simple GL programm:

#include <windows.h>
#include <Gl/glut.h>

int main()
{
    glClearColor (0.0, 0.0, 0.0, 0.0);
    glClear (GL_COLOR_BUFFER_BIT);
    glColor3f (1.0, 1.0, 1.0);
    glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
    glBegin(GL_POLYGON);
    glVertex3f (0.25, 0.25, 0.0);
    glVertex3f (0.75, 0.25, 0.0);
    glVertex3f (0.75, 0.75, 0.0);
    glVertex3f (0.25, 0.75, 0.0);
    glEnd();
    glFlush();
    return 0;
}

I'm building project using CLion and therefore here's my CMakeLists.txt:

cmake_minimum_required(VERSION 3.1)
project(MuspellsheimR)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

set(SOURCE_FILES main.cpp)
add_executable(MuspellsheimR ${SOURCE_FILES})

I've downloaded GLUT here and put glut.dll into C:\Windows\SysWOW64 (and in C:\Windows\System32 just in case), glut.h to C:\MinGW\include\GL and glut32.lib to C:\MinGW\lib. What's wrong?

Aucun commentaire:

Enregistrer un commentaire