aliens

Author Topic: Fixed build error with r146  (Read 6567 times)

Offline sir_nacnud

  • Captain
  • ***
  • Posts: 54
    • View Profile
Fixed build error with r146
« on: September 29, 2010, 03:04:50 am »
MovingTarget.cpp needed cmath included for sqrt().  Attached patch fixes this.

I noticed you had defined PI yourself in a couple of places in the code.  There is a define for PI in cmath, called M_PI.  Just a heads up in case you didn't know about it.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Fixed build error with r146
« Reply #1 on: September 29, 2010, 01:26:09 pm »
M_PI is not standard and I don't think it's included in VC++.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Fixed build error with r146
« Reply #2 on: September 29, 2010, 10:10:43 pm »
Fixed, apparently I needed to add:
#define _USE_MATH_DEFINES
So I just replaced one define with another, but consistency and all that. :P

Offline sir_nacnud

  • Captain
  • ***
  • Posts: 54
    • View Profile
Re: Fixed build error with r146
« Reply #3 on: September 30, 2010, 02:06:10 am »
Why not make _USE_MATH_DEFINES a compiler define so you don't have to define it each time you want to use M_PI?