Taose / Vegastrike-taose

Vega Strike, the 3D Space Simulation, Trading and Combat game.
11 stars 7 forks source link

Copysign conflicts with a previous declaration #1

Closed Taose closed 7 years ago

Taose commented 7 years ago

Basically, Vega Strike and cmath are not agreeing. Here's the error that I'm getting when running cmake.

In file included from /projects/Vegastrike/engine/src/cmd/../gfx/camera.h:24:0,
                 from /projects/Vegastrike/engine/src/cmd/beam_generic.cpp:8:
/projects/Vegastrike/engine/src/physics.h:30:34: error: ‘float copysign(float, float)’ conflicts with a previous declaration
 float copysign( float x, float y );
                                  ^
In file included from /usr/include/c++/6/math.h:36:0,
                 from /projects/Vegastrike/engine/src/vs_math.h:27,
                 from /projects/Vegastrike/engine/src/vegastrike.h:36,
                 from /projects/Vegastrike/engine/src/cmd/beam_generic.cpp:1:
/usr/include/c++/6/cmath:1288:3: note: previous declaration ‘constexpr float std::copysign(float, float)’
   copysign(float __x, float __y)
   ^~~~~~~~
CMakeFiles/engine_com.dir/build.make:614: recipe for target 'CMakeFiles/engine_com.dir/src/cmd/beam_generic.o' failed
make[2]: *** [CMakeFiles/engine_com.dir/src/cmd/beam_generic.o] Error 1
CMakeFiles/Makefile2:262: recipe for target 'CMakeFiles/engine_com.dir/all' failed
make[1]: *** [CMakeFiles/engine_com.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

This gets up to about 16% before causing issues. I suspect that this is to do with cmake having been updated somewhere but I'm not sure where. As you can see it suggests that it has already been declared with (float x, float y).

However, if comment out the vegastrike one, it leads to an ambiguity that the compiler also hates.

Taose commented 7 years ago

Appears to be fixed as of: copysignFix