Author Topic: Compiling Laserboy on OSX 10.9  (Read 18955 times)

0 Members and 1 Guest are viewing this topic.

Offline c60

  • Newbie
  • *
  • Posts: 10
  • Milliwatts: 0
    • View Profile
Compiling Laserboy on OSX 10.9
« on: November 21, 2013, 09:46:11 am »
Hi James,

  I followed the instructions for installing on osx 10.8 but the compilation fails with this error.

Code: [Select]
In file included from ./LaserBoy_space.hpp:34:
./LaserBoy_frame_set.hpp:259:38: error: parameter of overloaded 'operator++' cannot have a default argument
    LaserBoy_frame& operator ++ (int = 0) //post
                                     ^
./LaserBoy_frame_set.hpp:272:38: error: parameter of overloaded 'operator--' cannot have a default argument
    LaserBoy_frame& operator -- (int = 0) // post

Any ideas?

Offline James

  • Administrator
  • Hero Member
  • *****
  • Posts: 2132
  • Milliwatts: 47
  • Gender: Male
    • View Profile
    • LaserBoy !!!
Re: Compiling Laserboy on OSX 10.9
« Reply #1 on: November 21, 2013, 01:06:55 pm »
That's really weird! That is a standard part of the definition of C++ to overload the increment and decrement operators. That's how the compiler knows if you mean pre or post increment or decrement. In other words, are you defining

++object //pre increment
or
object++ //post increment


?

This can't be an OSX thing.... It must be a GNU GCC thing!

James.
« Last Edit: November 21, 2013, 10:05:10 pm by James »
LaserBoy is Sofa King Cool!
But it will never be Alpha King Done!

Offline samynosor

  • Newbie
  • *
  • Posts: 2
  • Milliwatts: 0
    • View Profile
Re: Compiling Laserboy on OSX 10.9
« Reply #2 on: August 12, 2014, 02:09:01 pm »
Hi there,

A solution for this problem is to manually modify LaserBoy_space.hpp lines 259 and 272 : change int = 0 by int

You should have :

LaserBoy_frame& operator ++ (int) //post

LaserBoy_frame& operator -- (int) // post

S.

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2024, SimplePortal