Hi @rasmusbarr !
Wonderful project! Coding a mini physic engine in a single .cpp file must be a tough challenge!
However, I posted this just to say that I've compiled it for Linux (I'm using Ubuntu 16.04 LTS 64bits), with the following changes to main.cpp:
#ifdef __APPLE__
#include <GLUT/GLUT.h>
#include <OpenGL/gl.h>
#elif _MSC_VER
#include <GLUT/glut.h>
#include <gl/gl.h>
#else // linux
#include <GL/glut.h>
#include <GL/gl.h>
#endif
// Not sure about mingw (if it's like linux or like _MSC_VER)
I just used this command line from the example folder::
g++ --std=c++11 main.cpp -o main -I"./" -I"../" ../nudge.cpp -lglut -lGL
# Or:
# clang++ --std=c++11 main.cpp -o main -I"./" -I"../" ../nudge.cpp -lglut -lGL
# optionally use --march=haswell (Using 8-wide AVX FMA: Enabled)
Without --std=c++11, g++ produces a lot of errors.
Strangely, using clang It compiles with only the following warnings:
../nudge.cpp:2928:41: warning: default template arguments for a function
template are a C++11 extension [-Wc++11-extensions]
template<unsigned data_stride, unsigned index_stride = 1, class T>
^ ~
../nudge.cpp:2973:41: warning: default template arguments for a function
template are a C++11 extension [-Wc++11-extensions]
template<unsigned data_stride, unsigned index_stride = 1, class T>
^ ~
../nudge.cpp:3030:41: warning: default template arguments for a function
template are a C++11 extension [-Wc++11-extensions]
template<unsigned data_stride, unsigned index_stride = 1, class T>
However these are just details. Thank you for this project!