First off, my code compiles and runs fine on Mac OS X with compiler
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1
but on Ubuntu with compiler
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
it won’t compile.
In my header I have
std::vector<Obstacle::Obstacle*> obstacles;
which gives the following compilation error in Ubuntu:
error: ‘Obstacle::Obstacle’ cannot appear in a constant-expression
Any ideas of what I need to change to make it work?
Is there some magical compile flag I should use on Ubuntu to make it work just as on OS X?
Thank you
EDIT: Obstacle is a class.
You cannot pass constructor pointer as stored type.
Instead of
try