Skip to content

Instantly share code, notes, and snippets.

@klemens
Last active December 17, 2015 02:29
Show Gist options
  • Save klemens/5536602 to your computer and use it in GitHub Desktop.
Save klemens/5536602 to your computer and use it in GitHub Desktop.
Compile CGViewer under Windows

Compile CGViewer under Windows

(tested on Windows 8 x64)

Ressources

Setup

  1. Extract all necessary files
  2. Copy glext.h into glew-1.9.0\include\GL
  3. Add mingw64\bin, Qt64-4.8.4\bin and glew-1.9.0\bin to PATH
  4. Add Qt64-4.8.4\mkspecs\win32-g++-4.6 to QMAKESPEC

Install Qt

  1. Fix Qt hardcoded paths: qtbinpatcher.exe --nobackup

Compile Glew

  1. gcc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.o -c src/glew.c
  2. gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o bin/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
  3. ar cr lib/libglew32.a src/glew.o

see http://stackoverflow.com/questions/6005076/building-glew-on-windows-with-mingw

Fix CGViewer

Model.h:

  • include <GL/glew.h> and <GL/glext.h>

Raytracer.cpp:

  • comment out OpenMP (produces error)

CGViewer.pro:

  • LIBS += -lglu32 -llibglew32 -Lglew lib path (forward slashes)
  • DEFINES += GL_GLEXT_PROTOTYPES
  • INCLUDEPATH += glew include path (forward slashes)

Compile CGViewer

  1. qmake
  2. mingw32-make debug
    mingw32-make clean
    mingw32-make release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment